RPM Package Management in RHEL For Beginners

In this guide, we try to provide RPM Package management 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 to see how you can install and remove RPM packages in RHEL with the rpm command and DNF package manager.

RPM Package Management in RHEL For Beginners

Before you start the setup guide, 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 point, 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

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 RPM Command in Linux

Use YUM and RPM Package Managers on AlmaLinux 8

Install .NET (dotnet) Core on AlmaLinux 9

Install Sniffnet Monitoring Tool on AlmaLinux 9

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!