How to install RPM files (packages) on CentOS Linux

RPM Package Manager (RPM) is a powerful package management system used by Red Hat Linux and derivatives such as CentOS and Fedora. RPM also refers to the rpm command and the .rpm file format.

The CentOS repos contain thousands of rpm’s that can be installed using the desktop software manager or from the command line using the yum, dnf and rpm utilities. Some libraries and applications are packaged in rpm format but are not included in any CentOS repository. These apps must be downloaded from the developer’s websites and installed manually.

In this article, we will show you how to install rpm files on CentOS.

Be especially careful when installing rpm packages from unofficial sources. The package must be built for your system architecture and CentOS version. Never replace or update major system packages such as glibc, systemd, or other services and libraries that are required for the system to function properly.

Only root or a user with sudo privileges can install or remove RPM packages.

yum and dnf are command line tools for installing, updating, uninstalling, and otherwise managing rpm packages on CentOS and related Linux distributions.

Since CentOS 8, yum has been replaced with dnf as the default package manager. dnf is backward compatible with yum.

You can continue to use yum on CentOS 8 as it is an alias for dnf.

To install local rpm packages using yum or dnf, use the install command followed by the path to the file. In the example below, we are installing the Chrome browser:

sudo yum install google-chrome-stable_current_x86_64.rpm
sudo dnf install google-chrome-stable_current_x86_64.rpm

Both yum and dnf will resolve and install all package dependencies. You will be prompted to enter Y to continue:

Install  69 Packages

Total size: 45 M
Total download size: 28 M
Installed size: 292 M
Is this ok [y/N]: 

That’s it, the application is installed on your system and you can start using it.

You can also install the rpm package directly from the URL:

sudo yum install
sudo dnf install

rpm – low-level package manager for RHEL systems

When installing, updating, and removing packages, you should always use yum or dnf over rpm as it does not remove dependencies.

To install rpm rpm packages, use the -i (or -U) option followed by the path to the file:

sudo rpm -i google-chrome-stable_current_x86_64.rpm

If the package you are installing or updating depends on other packages that are not currently installed, rpm will display a list of all missing dependencies. You will need to install all dependencies.

rpm also accepts installing packages from a URL:

sudo rpm -i google-chrome-stable_current_x86_64.rpm

On CentOS, you can install a local rpm file using yum or dnf, just like you install a package from the repositories.

Feel free to leave comments if you have any questions.