RPM commands to manage packages on RHEL based systems

RPM stands for Red Hat Package Manager is a powerful, command line Package Management utility for Red Hat based system such as CentOS, Oracle Linux & Fedora, Some of the other Linux distributions also using RPM packages openSUSE, Mageia & Scientific Linux.

The RPM utility allow you to install, upgrade, remove, query & verify the packages on Linux system/server.

RPM files comes with .rpm extension. RPM package built with required libraries and dependency which will not conflicts other packages were installed on your system.

Several front-end utilities are available to install RPM packages based on the distributions which will handle the installation process more efficiently compare with RPM utility, especially for handling the dependencies.

Navigate the below link for modern package managers for Linux distributions.

Command line package manager

If you preferring GUI package managers for Linux distributions, hit blow link.

GUI package manager

1) How to get/download rpm packages

We can download the rpm packages from distribution official repository, when it’s not available on distribution repository we can download from third party rpm web sites.

Third-party websites are below:

yum-utils is a collection of utilities and plugins to extend yum package manager activity.

[Install yum-utils.noarch pacakge to download rpm package]
# yum install yum-utils.noarch

Now, use yumdownloader utility to download RPM packages.

[download rpm package]
# yumdownloader nano

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.jaist.ac.jp
 * epel: dl.fedoraproject.org
 * extras: ftp.jaist.ac.jp
 * updates: ftp.jaist.ac.jp
nano-2.0.9-7.el6.x86_64.rpm             | 436 kB     00:01

[See the downloaded rpm package]
# ls -lh
-rw-r--r-- 1 root root 436K Jul  3  2011 nano-2.0.9-7.el6.x86_64.rpm

2) How to Install a software from RPM Package

For installing a software from RPM package, we need to add -i option with rpm command. Here i’m going to install nano software from rpm package.

[Install rpm package]
# rpm -ivh nano-2.0.9-7.el6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:nano                   ########################################### [100%]

Details

  • -i : Install a package
  • -v : Verbose
  • -h : print hash marks as package installs

3) How to Query a installed Particular RPM Package

We have installed nano software from rpm package. Now, i’m going to query the installed nano software details.

[Query Installed Particular RPM Package]
# rpm -q nano
nano-2.0.9-7.el6.x86_64

Details

  • -q : query operation

Magesh Maruthamuthu

Love to play with all Linux distribution

You may also like...

  • hello sir, the tutorial is more usefull for me.. Thanks a lot .. Now i need help .Please provide me the same sort of info for AWK & SED in linux and mail me to\
    [email protected]

    • Kalyan,
      Welcome to our GEEK, We don’t have article about AWK & SED till date. I have added this request in our todo list.

Close
Please support the site
By clicking any of these buttons you help our site to get better