In this tutorial, we will show you how to install RPM Packages on CentOS. For those of you who didn’t know, RPM Package Manager (RPM) is a powerful package management system used by Red Hat Linux and its derivatives such as CentOS and Fedora. The official CentOS repositories contain thousands of RPM packages that can be installed using the yum
or dnf
command-line utility. Packages that are not available in the standard CentOS repositories can be easily installed by enabling the appropriate repository.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the RPM Packages on CentOS Linux.
Prerequisites
- A server running one of the following operating systems: CentOS, Rocky Linux, AlmaLinux, Fedora, and RHEL-based.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install RPM Packages on CentOS
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf update
Step 2. Installing RPM packages with yum
and dnf
.
Use YUM or DNF package manager to install the downloaded rpm file. This will help you to install the dependencies required for the package:
sudo yum localinstall package-idroot.rpm ## Using yum command sudo dnf localinstall package-idroot.rpm ## Using dnf package
If for some reason you want to remove the installed package use the standard yum
or dnf
remove command followed by the package name:
sudo yum remove package-idroot.rpm ## Using yum command sudo dnf remove package-idroot.rpm ## Using dnf package
Step 3. Installing RPM packages with rpm
.
Use rpm
the command to install any packages on Redhat-based systems. To install a package use -i
the command line switch followed by the package path on your system:
sudo rpm -i package-idroot.rpm
If you are upgrading from an earlier version of the software package, run RPM in upgrade mode, as in the following example:
sudo rpm -U package-idroot.rpm
The RPM installer can be used to remove (or uninstall) a software package. Enter the following into a terminal:
sudo rpm –e package-idroot.rpm
Congratulations! You have successfully installed RPM Packages. Thanks for using this tutorial for installing RPM Packages on your CentOS system. For additional help or useful information, we recommend you check the official RPM website.