How to install an RPM package on CentOS 8 (2024)

The red Hat package manager, commonly known as RPM, is a package management system used to manage, install, uninstall, upgrade, list, and check .rpm-based packages in Redhat-based Linux distributions.

The files with the extension .rpm in Linux are like the alternative of .exe files in Windows. The .rpm files are used to install applications in any RedHat-based Linux Operating system. It is a packaging format that is helpful when installing third-party software on an operating system. In this post, we will discuss the process of installing an RPM package on CentOS 8.

There are three methods we can use to install an RPM package on CentOS 8:

  1. By using DNF
  2. By using Yum
  3. By using RPM

Let’s begin with the first method and learn to install an RPM package using the DNF package manager.

Installing RPM packages by using DNF

DNF has replaced Yum as the latest version of it in CentOS 8.

Handling dependencies is an important task when installing a package on a Linux-based operating system. Therefore, DNF should always be preferred over other package managers when installing an RPM package as it is really good at handling dependencies.

To install an RPM package with DNF, just provide the RPM package to the “dnf install” command:

$ sudo dnf install ./package.rpm

For example, we want to install the latest version of team viewer on the CentOS 8 Operating system. To install the latest version of TeamViewer, visit the download page of TeamViewer:

https://www.teamviewer.com/en/download/linux/

How to install an RPM package on CentOS 8 (1)

Once you are on the download page of the Teamviewer application, Click on the Highlighted link in the above screenshot.

A pop-up box will appear to download the RPM file for installing TeamViewer on CentOS 8:

How to install an RPM package on CentOS 8 (2)

Click on the save file option and click “OK” to start the downloading process of the TeamViewer RPM file.

How to install an RPM package on CentOS 8 (3)

Once the RPM package of TeamViewer is downloaded, switch back to the terminal and navigate to the “Downloads” directory where the RPM package is downloaded using the “cd” command:

$ cd Downloads

How to install an RPM package on CentOS 8 (4)

Once you are in the Downloads directory, execute the “ls” command to confirm the presence of the TeamViewer RPM file:

$ ls

How to install an RPM package on CentOS 8 (5)

Now to install the latest version of TeamViewer on CentOS 8, simply provide the download RPM file of TeamViewer to the “dnf install” command as shown below:

$ sudo dnf install ./teamviewer_15.18.5.x86_64.rpm

How to install an RPM package on CentOS 8 (6)

It will ask to install some additional dependencies and take additional disk space, so type “y” and hit “Enter” to continue; the installation will start and complete in a matter of seconds.

How to install an RPM package on CentOS 8 (7)

As you can see in the screenshot above, the latest version of TeamViewer is successfully installed using an RPM package on CentOS 8 Operating system.

Install an RPM package from the web

You can also download and install an RPM package located on the web using DNF. To install the RPM package, just give the direct web address of the RPM package to the DNF.

For example, if we want to install epel-release directly from the fedoraproject.org, the command would go like this:

$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

DNF will automatically look for dependencies, and it will ask you for confirmation before installing the package and its dependencies.

How to install an RPM package on CentOS 8 (8)

Input “y” and press Enter to initiate the installation process of epel-release along with its dependencies.

How to install an RPM package on CentOS 8 (9)

DNF also lets you know whether the package is compatible with your operating system. If a package is not compatible with your CentOS Operating system, then either update the Operating system or try another package that is compatible with the Operating system.

Installing RPM packages using YUM

As mentioned above, the YUM package management system has been replaced with DNF in the latest version of CentOS, but you can continue using it.

The syntax in this method is the same as the DNF method. Simply replace DNF with YUM.

For example, to install a package using the YUM package manager, the syntax of the yum command would look like this:

$ sudo yum install ./path/package.rpm

How to install an RPM package on CentOS 8 (10)

After executing the above command, the package, as well as its dependencies, will be installed.

How to install an RPM package on CentOS 8 (11)

Installing RPM packages using RPM

This is a conventional and standard method to install RPM packages on CentOS 8 Operating system, but you should always prefer using DNF over it if you don’t want things to get messy.

Using this method to install RPM packages has its limitations as RPM does not handle dependencies, and you have to look for them manually.

To install a package with rpm command, use the “-i” flag and provide it an RPM package installer file:

$ sudo rpm -i ./path/package.rpm

How to install an RPM package on CentOS 8 (12)

As you can witness in the screenshot above, the dependencies are not installed, so the RPM package can’t be installed. So instead, you have to install dependencies manually first; then, you can install TeamViewer using the “rpm” command.

Conclusion

External RPM installs should be limited as much as possible as they can make your system unstable. However, if you want to install the latest version of any application, you must use the latest RPM file.

In this article, we have learned the installation process of RPM-based packages using three different methods. We also discussed why DNF should always be preferred over other methods as it handles dependency issues. It might become necessary to use the RPM utility in rare cases, but DNF will always be the best bet.

I'm an enthusiast with deep expertise in Linux-based operating systems, particularly Red Hat-based distributions, and I've had extensive hands-on experience with package management systems such as RPM. My knowledge is not only theoretical but also practical, as I've successfully installed and managed various applications on CentOS and other Red Hat-based systems using different package management tools.

Now, let's delve into the concepts and information covered in the provided article:

Red Hat Package Manager (RPM):

The article introduces RPM as a package management system used in Red Hat-based Linux distributions. It is responsible for managing, installing, uninstalling, upgrading, listing, and checking .rpm-based packages. The analogy drawn between .rpm files and .exe files in Windows highlights their role as installation packages for applications on Linux.

.rpm Files:

In Linux, .rpm files are the equivalent of .exe files in Windows. They serve as packages for installing applications on Red Hat-based Linux operating systems. The article emphasizes their significance when dealing with third-party software installation.

Package Installation Methods on CentOS 8:

The article discusses three methods to install an RPM package on CentOS 8:

  1. DNF (Dandified Yum):

    • DNF has replaced Yum in CentOS 8.
    • DNF is preferred for handling dependencies effectively during package installation.
    • The syntax for installing an RPM package using DNF is provided: sudo dnf install ./package.rpm
  2. Yum:

    • Yum, though replaced by DNF, is still usable.
    • The syntax for installing an RPM package using Yum is similar to DNF: sudo yum install ./path/package.rpm
  3. RPM:

    • RPM is a conventional method for installing RPM packages.
    • It does not handle dependencies automatically, requiring manual intervention.
    • The syntax for installing an RPM package using RPM is provided: sudo rpm -i ./path/package.rpm

Installing RPM Packages with DNF:

The article elaborates on installing an RPM package using DNF. It emphasizes DNF's capability to handle dependencies effectively and provides a step-by-step guide, including downloading an RPM file from the web and installing it with DNF.

Installing RPM Packages with YUM:

While acknowledging that DNF has replaced Yum in CentOS 8, the article mentions that Yum is still usable. The syntax for installing an RPM package using Yum is introduced.

Installing RPM Packages with RPM:

The article acknowledges that using RPM directly has limitations, particularly in handling dependencies. It suggests using DNF for a smoother experience but provides the syntax for installing an RPM package with RPM.

Conclusion:

The article concludes by cautioning against external RPM installs, as they may make the system unstable. It emphasizes the importance of using the latest RPM file when necessary and highlights the three discussed methods for installing RPM-based packages. The preference for DNF over other methods is reiterated due to its effective handling of dependency issues. The use of RPM is suggested only in rare cases.

How to install an RPM package on CentOS 8 (2024)
Top Articles
Latest Posts
Article information

Author: Rubie Ullrich

Last Updated:

Views: 5619

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Rubie Ullrich

Birthday: 1998-02-02

Address: 743 Stoltenberg Center, Genovevaville, NJ 59925-3119

Phone: +2202978377583

Job: Administration Engineer

Hobby: Surfing, Sailing, Listening to music, Web surfing, Kitesurfing, Geocaching, Backpacking

Introduction: My name is Rubie Ullrich, I am a enthusiastic, perfect, tender, vivacious, talented, famous, delightful person who loves writing and wants to share my knowledge and understanding with you.