How to Install RPM Pacakges on CentOS

  1. Install RPM Packages Using yum
  2. Remove the RPM Pacakge Using yum
  3. Install RPM Packages Using yum
  4. Update the RPM Pacakge Using rpm
  5. Remove the RPM Pacakge Using rpm

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 like curl and wget
    wget https://repo.com/package.rpm
    

    It goes to the site repo.com and downloads the package package.rpm in the current working directory.

  • Now we install the downloaded package using the yum localinstall command:
    sudo yum localinstall package.rpm
    

    It will ask for confirmation, and if we type y and hit enter, the command will install the package.rpm package. 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 install rpm packages using yum.
    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 like curl and wget
    wget https://repo.com/package.rpm
    

    It goes to the site repo.com and downloads the package package.rpm in the current working directory.

  • Now we install the downloaded package using the rpm command with -i option:
    sudo rpm –i package.rpm
    

    It 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 -v option to the command and -h option to view the verbose output.

  • Alternatively, we can use the following command to download and install rpm packages using rpm.
    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.

comments powered by Disqus