RPM is a red-hat package manager enabling you to install, remove, query, verify and update RPM packages in Unix/Linux systems. This powerful management tool is a free and open-source program that anyone can use. Some rpm packages have dependencies that are required to function in other vital packages. This package manager only works in red-hat-based distros like CentOS, RHEL, and Fedora, not in Debian-based distros like Ubuntu. In this article, I will show you how to uninstall rpm packages in Red-Hat Enterprise Linux with or without dependencies by using the rpm command.
- Learning about package management systems of Unix/Linux.
- Knowing about the uninstallation method using rpm.
- Learning about the rpm package dependencies.
- You should log in as a root user to uninstall or remove any package from Linux systems.
- Must be registered in Red-hat Linux.
Process Flow Chart
[Distro Used Throughout the Tutorial: RHEL 9.2]
2 Simple Cases to Uninstall RPM From Unix/Linux-based Systems
Many popular red hat-based distros like Fedora, CentOS, and RHEL by default use rpm (red-hat package manager) to install, uninstall, and upgrade rpm packages directly into the system. So, you don’t need to convert the rpm packages to any other format. Now, I will explain to you the uninstallation procedure of the google chrome software package. Follow the steps carefully:
Case 01: Uninstalling Packages Without Reliant Dependencies Using RPM Command
Some dependencies are dependent on other packages. For that reason, removing those can damage other packages. Hence, follow this method to avoid this problem:
Steps to Follow >
➊ First, open the Red-hat Enterprise terminal.
➋ Click ‘Show Applications’ to check the installed package you are going to remove.
You can see that the google chrome software is installed here.
❸ Now, write the code to remove the google chrome package without its reliant dependencies:
sudo rpm -e google-chrome-stable
After executing the command, you can check that there is no google chrome software available in your Linux system.
In this image, you can see that the google chrome software is no longer here.
Case 02: Uninstalling Packages With All Dependencies Using RPM Command
The previous rpm code can remove packages with their unused dependencies but not all the dependencies. In this case, I will show you how to delete all the dependencies of a package whether they are in use or not. Now, follow some steps as instructed below:
Steps to Follow >
➊ Write this command to query all the rpm packages:
➋ Now, scroll down and find the google chrome package.
➌ After finding the Google Chrome package, write the next command to remove it with all the dependencies.
Sudo rpm -e --nodeps google-chrome-stable
After typing the password, you will find that the google chrome software is uninstalled from your system with all the dependencies.
Additional Options for RPM
There are multiple options to manage packages with rpm. These options may help you get more control over the rpm command. So here they are:
|Command (short form)||Description|
|– – install (-i)||Installs packages.|
|– – force (-f)||Forces the operation to proceed even if there are errors.|
|– – upgrade (-U)||Upgrades packages.|
|– – list (-l)||Lists files in a package.|
|– – query (-q)||Queries packages.|
|– – hash (-h)||Prints hash marks as the package installs.|
|– – verbose (-v)||Provides more detailed output.|
|– – state (-s)||Displays the state of the listed files.|
|– – verify (-V)||Verifies packages.|
I hope you can now easily uninstall any rpm package file you want to remove. In this article, I have explained 2 simple cases to do the job. You may go through any case you want. If you wish to remove a package with all dependencies go for case 02 otherwise go for case 01. Remember, don’t miss out on any steps, just follow the instructions attentively to complete your task successfully. Good luck!
People Also Ask
- How to Uninstall a YUM Package [2 User-Friendly 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]