How to Uninstall RPM in Linux [2 Simple Cases]

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.

Key Takeaways

  • 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]describing two cases of how to uninstall rrpm package

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:

NOTE: Before removing any packages, having backups is always appreciable. As most rpm packages have dependencies when you uninstall any package that can hamper other dependencies depending on it.

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.

checking installed rpm package of google chrome software

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
  • 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.

running rpm command to uninstall package

After executing the command, you can check that there is no google chrome software available in your Linux system.

checking to ensure that the rpm package of the google chrome software is uninstalled successfully

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:

rpm -qa
  • -qa: Command option to query all the rpm packages.

command to query all the rpm packages

➋ Now, scroll down and find the google chrome package.

finding the rpm package to uninstall

➌ After finding the Google Chrome package, write the next command to remove it with all the dependencies.

Sudo rpm -e --nodeps google-chrome-stable
  • – – nodeps: Command option to remove packages with all their dependencies.

removing google chrome rpm package with all its dependencies

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 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

<< Go Back to Uninstall Packages in Linux | Package Management in Linux | Learn Linux Basics

Rate this post
Mitu Akter Mou

Hello, This is Mitu Akter Mou, currently working as a Linux Content Developer Executive at SOFTEKO for the Linuxsimply project. I hold a bachelor's degree in Biomedical Engineering from Khulna University of Engineering & Technology (KUET). Experiencing new stuff and gathering insights from them seems very happening to me. My goal here is to simplify the life of Linux users by making creative articles, blogs, and video content for all of them. Read Full Bio

Leave a Comment