RPM Package Manager (RPM) is a powerful package management system, which is used by RedHat Linux and its derivative versions such as CentOS, Fedora, etc. RPM is associated with rpm
command and .rpm
file format.
The CentOS software source contains thousands of rpm packages. These software packages can be installed using desktop software management tools or by using the command line yum
, dnf
and rpm
tools. Some libraries and applications are packaged in rpm format, but are not included in any CentOS software source repositories. Those applications need to be manually downloaded from the developer's website and need to be installed manually.
In this guide, we will explain how to install rpm files on CentOS.
When you install rpm packages from unofficial sources, you need to be extra careful. This package must be built for your system architecture and CentOS version. Never replace or update basic system software packages, such as glibc, systemd, or other services or tools. These are the basic software to ensure the normal operation of the system.
Only as root or another user with sudo privileges can install or remove RPM packages.
yum
and dnf
to install rpm files## Both yum
and dnf
are command-line tools, they are used to install, upgrade, remove and manage rpm packages in CentOS and other Linux distributions.
Starting from CentOS 8, dnf
will replace yum
as the default package management tool, and dnf
is backward compatible with yum
.
You can continue to use yum
on CentOS 8, because it is an alias of dnf
.
To use yum
and dnf
to install a local rpm package, use the install
command and add the local path of the file. In this example, we will install 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 dependent packages. If prompted, 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 has been installed on your system and you can start using it.
You can also install a rpm package directly from a URL address:
sudo yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
sudo dnf install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
rpm
to install rpm file## rpm
is a low-level software management tool on RHEL system.
You should always use yum
and dnf
instead of rpm to install, upgrade, and remove packages, because rpm
will not solve dependency problems.
To install the rpm package using rpm
, please use rpm
plus -i
(or -U
) option plus file path:
sudo rpm -i google-chrome-stable_current_x86_64.rpm
If the package you are installing or upgrading depends on other packages that are not installed, rpm
will display a series of missing dependent software. You need to install all the dependent software yourself.
` rpm also accepts to install packages via URL:
sudo rpm -i google-chrome-stable_current_x86_64.rpm
On CentOS systems, you can use yum
or dnf
to install a local rpm file, just like you install from a software source.
Recommended Posts