In Red-hat-based Linux systems, YUM (Yellowdog Updater Modified) is a popular package manager for managing software packages. You might download some packages when you need them but now you may feel that those are no longer required and occupy your storage space. In that case, uninstalling that undesired software is crucial. You can use the yum command to do this task. In addition, there is another command which is dnf, the updated version of yum command, you can also use it to uninstall any package. Keep in touch to know more about the procedure in detail.
- Learning about the features of YUM command.
- Learning about how to uninstall packages using YUM.
- Learning about dnf command.
- Must be a root user to have sudo privileges.
- Must be registered in Red-hat-based Linux.
Process Flow Chart
[Distro Used Throughout the Tutorial: RHEL 9.2]
2 User-friendly Cases to Uninstall YUM in Linux
It is the modern package manager that Red-hat-based distros like Fedora, CentOS, and RHEL use. With these distros, if you want to uninstall any package, utilize this command. dnf command is also included here that give better result than yum. Now, I will explain to you how to uninstall the google chrome package with these commands. Additionally, I will cover managing package dependencies.
Case 01: Uninstalling Packages without All the Dependencies with YUM Command
Here, I will describe the detailed process of uninstalling the google chrome package. Packages have dependencies to function properly. In this case, you may not want to remove all the package dependencies. So follow the steps carefully:
Steps to Follow >
➊ Check the location of the google chrome package. Write this code to find the package:
sudo yum list installed | grep google-chrome-stable.x86_64
➋ Now, write this code to uninstall the google chrome software package:
sudo yum remove google-chrome-stable
In this image, you can see that after typing y, the package will be deleted with unused dependencies as this single command alone can remove unwanted software packages with their unused dependencies.
However, if you wish to delete all other unused dependencies, go through case 02.
Case 02: Removing All the Dependencies of Packages with YUM Command
Some unused dependencies still may exist, therefore, use the ‘yum autoremove’ command, all the unnecessary dependencies of your Google Chrome package, as well as other packages, will be removed. Now, follow the next steps to do so:
Steps to Follow >
➊ First of all, check all the dependencies of the google chrome package by writing this command:
sudo yum deplist google-chrome-stable
You can see all the dependencies of the google chrome package in this picture. By changing the package name, you can check other package dependencies in the same way. These unnecessary dependencies can minimize the space by occupying lots of storage space. Hence, run this command to remove all other unused dependencies.
Give permission to continue this process by typing ‘y’.All the unused dependencies are successfully removed from the Linux system. Now to delete metadata, cache files, run this command:
sudo yum autoremove
sudo yum clean all
Now you can notice in this image that 24 files have been removed from the Red-hat Linux including metadata and caches.
How to Uninstall a Package with dnf (An Advanced Version of YUM Command)
dnf refers to the dandified yum which is the same as yum command but a more updated one. It has several additional features than the yum command. However, people usually use yum as it is well documented, on the contrary, dnf command uses less memory storage and hence shows good performance and a better dependency resolver. If your device support dnf then go for it.
Now, I will show you how to uninstall the package with dnf command. Check the steps mentioned below:
Steps to Follow >
➊ Open the Red-hat terminal.
➋ Write this code to uninstall the google chrome package:
sudo dnf remove google-chrome-stable
Here you can see that like the yum command, this dnf command will also erase the google chrome package as soon as you type y. In the same way, you can do all the similar tasks as yum with this dnf command but with better performance.
Additional Options of YUM Command
To have more control over yum command, you can check this table contained some important options:
|Command (short form)||Description|
|– – install (-i)||Installs packages.|
|– – refresh (-r)||Forces a refresh of the metadata cache|
|– – force (-f)||Forces the operation to proceed even if there are errors.|
|– – debug (-d)||Enables debugging output.|
|– – upgrade (-U)||Upgrades packages.|
|– – assumeyes (-y)||Answers yes to all questions automatically.|
|– – quiet (-q)||Suppresses output.|
|– – verbose (-v)||Increases verbosity|
|– – config config_file (-C)||Specifies a configuration file.|
|– – cachedir cache_dir (-c)||Specifies a cache directory.|
|– – help (-h)||Displays help information.|
I hope now you can uninstall any package with yum/dnf command. In this article, I have covered how to uninstall packages with dependencies using the yum command. Also, you can remove all the unnecessary dependencies of your Linux system by reading this article. Moreover, you can check the dependency list with yum command. dnf is the latest command of yum with more features which is also explained here. Best wishes.
People Also Ask
- How to Uninstall RPM in Linux [2 Simple Cases]
- How to Remove a Specific Version Using YUM [2 Easy Methods]
- How to Force Remove a Package Without Dependencies Using Yum [2 Methods]
- How to Remove and Purge a Package Using apt-get [4 Methods]
- How to Remove Apt-key in Linux [3 Practical Methods]
- How to Remove Package and Dependencies Using dpkg [4 Cases]