FUNDAMENTALS A Complete Guide for Beginners
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.
[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:
1. 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 these steps to avoid this problem:
- First, open the Red-hat Enterprise terminal.
- Click ‘Show Applications’ to check the installed package you are going to remove.
- Now, write the code to remove the google chrome package without its reliant dependencies:
sudo rpm -e google-chrome-stable
EXPLANATION- sudo: Gives administrative privileges.
- rpm: Red-hat package manager to install, uninstall, and manage software packages.
- -e: Command option to erase software package.
- google-chrome-stable: Package name.
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.
2. 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 steps as instructed below:
- Write this command to query all the rpm packages:
rpm -qa
- 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.
Options for RPM
These options may help you get more control over the rpm command:
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. |
Conclusion
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 can I uninstall RPM?
To uninstall an RPM package, you can use the rpm command with the -e
flag. Here’s an example:
sudo rpm -e package_name
In this example, replace package_name
with the name of the package you want to uninstall.
How to extract files from RPM without installing it?
You can convert the rpm file to a cpio format for extracting rpm files without installing it. Run command rpm2cpio package.rpm > package.cpio
to convert the file then write cpio -idmv < package.cpio
to extract files in your current directory.
What is inside RPM file?
RPM file contains all the necessary files and contents needed to install or distribute any software. It has metadata such as package name, version, dependencies, release, and other information about the package. Also, it contains scripts written in the shell run during package installation and removal. Moreover, a rpm package with a signature ensures the authenticity of the box.
Is it possible to uninstall RPM packages in Linux without dependencies using yum?
YUM (Yellowdog Updater Modified) is a red-hat-based package manager used to install, uninstall or modify software packages. Just write sudo yum remove - -nodeps package-name
to uninstall your desired package without dependencies.
Related Articles
- 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]
<< Go Back to Uninstall Packages in Linux | Package Management in Linux | Learn Linux Basics