Fedora

How to Uninstall a Package on Fedora Linux

Uninstalling packages from the Linux system is suitable to remove unnecessary files and free up some Disk space. You can uninstall the unrequired packages that run in the background to improvise the system responsiveness and for smoother computing experience. Moreover, the packages you installed can sometimes lead to potential security risks and can make your system vulnerable to attacks.

However, it is important to check the packages before uninstalling. Otherwise, you may delete the essential packages that can harm the system’s working. Hence, if you are new to Fedora Linux, you must understand how to uninstall any packages. In this short tutorial, we will explain the different methods to uninstall a package on Fedora Linux.

How to Uninstall a Package on Fedora Linux

Here, we will explain the different commands that you can try to uninstall the packages from your Fedora system.

The Dnf Remove Command

You can use the “remove” command to uninstall the package quickly. For example let’s uninstall GCC (GNU Compiler Collection) from the system through the following command:

sudo dnf remove gcc

The “dnf remove” command removes all the dependencies of a package but does not delete its configuration files. It helps the users to reinstall the package later without losing the configurations that they previously used. However, if you want to remove everything, including the configuration files, you can use the “sudo dnf erase” command.

The Dnf Erase Command

This command works the same as the “remove” command, but it also removes the configuration file and wipes the complete data of a package. Let’s remove the GCC from the system including its config data:

sudo dnf erase gcc

If you want to remove the package group from the system, you can use one of the following commands:

sudo yum groupremove "<Package Group>"

sudo yum greoupremove <package-group>

sudo yum remove @<package-group>

All you need to do is replace <Package Group> with the one that you want to replace. For example, let’s uninstall GNOME using one of the previous commands:

sudo yum groupremove "GNOME"

sudo yum greoupremove gnome

sudo yum remove @gnome

Conclusion

This is all about how you can uninstall a package on Fedora Linux. We only included the commands in the tutorial since uninstalling the packages from the system can be done right from the terminal. Ensure that you run the commands in the sudo privileges. Otherwise, you may get an error while removing the packages.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.