Share your love
RPM Package Management in RHEL – 3 Easy Steps

In this guide, we try to provide RPM Package Management in RHEL For Beginners steps including installing and removing an RPM package in RHEL, AlmaLinux, Rocky Linux, and Fedora. As you may know, RPM stands for RedHat Package Manager which is used in RHEL-based distros like AlmaLinux, Rocky Linux, etc. It is used for installing, updating, and uninstalling software on a Linux system. Also, RPM packages are installed, updated, or removed using the RPM command or other package management tools like DNF.
Now you can follow the steps below provided by the Orcacore to see how you can install and remove RPM packages in RHEL with the rpm command and DNF package manager.
Table of Contents
RPM Package Management in RHEL For Beginners
Before you start RPM Package Management in RHEL, you need to access your server as a root or non-root user with sudo privileges. In this guide, we use AlmaLinux 9 to show you the guide steps. Also, you can use this instruction for any RHEL-based distro like Rocky Linux or Fedora.
Step 1 – Download an RPM Package
First, you must download your desired RPM package. You can use the wget command to download your desired package:
sudo wget your-rpm-package-url
For example, we download the following Google RPM package:
sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Step 2 – Install an RPM Package in RHEL
At this step of RPM Package Management in RHEL, you can use the DNF and rpm commands to install your package. Let’s see how you can do it.
To install the package with the rpm command, you can use the following format:
sudo rpm -ivh package_name.rpm
For example, to install the above downloaded RPM package, we use:
sudo rpm -ivh google-chrome-stable_current_x86_64.rpm
Note: The rpm command does not resolve dependencies. If the package has dependencies, you need to install them manually.
Another way that you can install an RPM package in RHEL is to use the default DNF package manager. To do this, you can run:
sudo dnf install ./package_name.rpm
For example:
sudo dnf install ./google-chrome-stable_current_x86_64.rpm
Step 3 – Uninstall and Remove an RPM Package in RHEL
At this step of RPM Package Management in RHEL, If you want to remove an RPM package from your RHEL distro, you can easily use RPM or DNF commands.
To remove an RPM package with the RPM command, you can use the following format:
sudo rpm -e package_name
Remember to specify just the package name without the ‘.rpm’ extension. The ‘-e‘ option refers to erase.
For example:
sudo rpm -e google-chrome-stable_current_x86_64
Also, you can use the DNF to remove your RPM package in RHEL:
sudo dnf remove package-name
For example:
sudo dnf remove google-chrome-stable_current_x86_64
That’s it, you are done. You can easily use the DNF and RPM commands to install and remove an RPM package in RHEL.
Summing Up
In summary, an RPM package is a standard method for distributing and managing software in many Linux distributions. It simplifies the process of installing, updating, and maintaining software, although it requires a package manager like DNF to handle dependencies effectively. Hope you enjoy this guide on RPM Package Management in RHEL.
Also, you may like to read the following articles:
Install RPM Packages on Ubuntu 22.04
Use YUM and RPM Package Managers on AlmaLinux 8
FAQs
What is RPM in RHEL, and how does it work?
RPM stands for RedHat Package Manager which is used in RHEL-based distros like AlmaLinux, Rocky Linux, etc. It is used for installing, updating, and uninstalling software on a Linux system.
How do I install a package using RPM on RHEL?
To install the package with the rpm command, you can use the following format:sudo rpm -ivh package_name.rpm
How do I find dependencies for an RPM package in RHEL?
You can find out what dependencies a RPM file has with the following commands:sudo rpm -qpR {.rpm-file}
sudo rpm -qR {package-name}