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:
- By using DNF
- By using Yum
- 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:
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:
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:
Click on the save file option and click “OK” to start the downloading process of the TeamViewer RPM file.
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:
Once you are in the Downloads directory, execute the “ls” command to confirm the presence of the TeamViewer RPM file:
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:
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.
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:
DNF will automatically look for dependencies, and it will ask you for confirmation before installing the package and its dependencies.
Input “y” and press Enter to initiate the installation process of epel-release along with its dependencies.
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:
After executing the above command, the package, as well as its dependencies, will be installed.
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:
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.
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.