How to Install RPM Pacakges on CentOS
- 
          
            Install RPM Packages Using yum
- 
          
            Remove the RPMPacakge Usingyum
- 
          
            Install RPM Packages Using yum
- 
          
            Update the RPMPacakge Usingrpm
- 
          
            Remove the RPMPacakge Usingrpm
 
RPM stands for Redhat Package Manager, a package manager tool for Red Hat-based distros of Linux like CentOS and Fedora. We can install RPM packages on CentOS using yum and rpm command-line utilities.
Before installing any RPM packages in our system, we must check the system compatibility of those packages and make sure the version of the package we are going to install is supported by the current OS installed in our system.
Similarly, to install RPM packages, we must also be logged in as superuser or user with the sudo privileges.
Before installing the packages, we need to download the packages in our system. We can either directly download from the Internet using the browser or use command-line utilities like wget or curl to download the packages.
Install RPM Packages Using yum
yum is a command-line utility for Red-Hat based Linux distros to download, install, update and remove packages. To install RPM packages using yum, we follow the following steps:
- 
At first, we download the package either directly using the browser or using command-line utilities likecurlandwgetwget https://repo.com/package.rpmIt goes to the site repo.comand downloads the packagepackage.rpmin the current working directory.
- 
Now we install the downloaded package using theyum localinstallcommand:sudo yum localinstall package.rpmIt will ask for confirmation, and if we type yand hit enter, the command will install thepackage.rpmpackage. The command will also install all the missing dependencies if our system allows the dependencies to be installed. If the command cannot install dependencies, it will list all the missing dependencies, and we will have to install them manually.
- 
Alternatively, we can use the following command to download and installrpmpackages usingyum.sudo yum localinstall https://repo.com/package.rpm
Remove the RPM Pacakge Using yum
To remove the installed RPM package, we can use the yum remove command followed by the name of the package to be removed.
sudo yum remove package.rpm
It will remove the package package.rpm from our system.
Install RPM Packages Using yum
rpm is also a command-line utility for Red-Hat based Linux distros to download, install, update and remove packages. To install RPM packages using rpm, we follow the following steps:
- 
At first, we download the package either directly using the browser or using command-line utilities likecurlandwgetwget https://repo.com/package.rpmIt goes to the site repo.comand downloads the packagepackage.rpmin the current working directory.
- 
Now we install the downloaded package using therpmcommand with-ioption:sudo rpm -i package.rpmIt will install the package package.rpm, and if there are any missing dependencies, the command will list all the missing dependencies, and we will have to install them manually.
 We add the-voption to the command and-hoption to view the verbose output.
- 
Alternatively, we can use the following command to download and installrpmpackages usingrpm.sudo rpm -ivh https://repo.com/package.rpm
Update the RPM Pacakge Using rpm
To remove the installed RPM package, we use the rpm command with -U option followed by the name of the package to be updated.
sudo rpm -Uvh package.rpm
It will update the package package.rpm in our system.
Remove the RPM Pacakge Using rpm
To remove the installed RPM package, we use the rpm command with -e option followed by the name of the package to be removed.
sudo rpm -evh package.rpm
It will remove the package package.rpm from our system.
Suraj Joshi is a backend software engineer at Matrice.ai.
LinkedIn