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:
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:
If you want to remove the package group from the system, you can use one of the following commands:
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 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.