RPM(Redhat Package Manager) is a command line bundle control utility used for installing, uninstalling, updating, querying and verifying software program packages. This article I will give an explanation for a number of the most commonplace Linux rpm commands for a machine admin. Some of the RPM Based Linux Distros are Redhat, Centos, Fedora, and OpenSuse. Yum and DNF are frontends for RPM Management that have more capabilities and will triumph over the constraints it has.

How to get RPM packages
There are several techniques available to get RPM applications as shown beneath.



Software CD/DVD
CentOS Mirror
RedHat (Need account)
Any open repository web sites
Basic modes for RPM command
Install : It is used to put in any RPM package.
Remove : It is used to erase, eliminate or un-installation any RPM package.
Upgrade : It is used to replace the prevailing RPM package deal.
Query : It is used to query any RPM bundle.
Verify : It is used to verify RPM programs.
Examples for RPM bundle
GeoIP application GeoIP-1.Five.Zero-eleven.El7.X86_64.Rpm is a RPM Package Library for u . S ./town/enterprise to IP address or hostname mapping . GeoIP is the package deal call, model is 1.5.Zero-11.El7, release is 7 and structure .X86_64.

Install
1) How to understand records of RPM bundle with out installing
After we've downloaded a bundle and we want to realize the information of a package deal before putting in. We can use -qipoption (question data bundle) to list the statistics of a package deal.

$ sudo rpm -qip GeoIP-1.5.Zero-eleven.El7.X86_64.Rpm
output
Name        : GeoIP
Version     : 1.Five.0
Release     : eleven.El7
Architecture: x86_64
Install Date: (no longer set up)
Group       : Development/Libraries
Size        : 2905020
License     : LGPLv2+ and GPLv2+ and CC-BY-SA
Signature   : RSA/SHA256, Sun 20 Nov 2016 05:49:19 PM UTC, Key ID 24c6a8a7f4a80eb5
Source RPM  : GeoIP-1.Five.0-11.El7.Src.Rpm
Build Date  : Sat 05 Nov 2016 08:29:17 PM UTC
Build Host  : worker1.Bsys.Centos.Org
Relocations : (no longer relocatable)
Packager    : CentOS BuildSystem 
Vendor      : CentOS
URL         : http://www.Maxmind.Com/app/c
Summary     : Library for u . S ./town/enterprise to IP address or hostname mapping
Description :
GeoIP is a C library that allows the user to locate the u . S . That any IP
deal with or hostname originates from. It uses a report primarily based database that is
correct as of June 2007 and might optionally be up to date on a weekly
basis by way of installing the GeoIP-update package. This database without a doubt carries IP
blocks as keys, and countries as values. This database should be greater complete
and accurate than using reverse DNS lookups.

This bundle consists of GeoLite records created by way of MaxMind, available from
http://www.Maxmind.Com/
2) How to put in RPM package deal
We can use -ivh parameters to install a specific bundle as shown under.

$ sudo rpm -ivh GeoIP-1.Five.0-eleven.El7.X86_64.Rpm
    Output
    Preparing...                          ################################# [100%]
        bundle GeoIP-1.Five.0-11.El7.X86_64 is already established
3) How to test an set up RPM package
We can use -q option with package call, It will show whether an rpm package deal set up or now not.

$ sudo rpm -q GeoIP
output
GeoIP-1.Five.Zero-eleven.El7.X86_64
four) How to List all files for specific installed RPM package
We can list all of the documents of an installed rpm applications, By the usage of the -ql alternative with rpm command.

$ sudo rpm -ql GeoIP
output
/etc/GeoIP.Conf
/etc/GeoIP.Conf.Default
/usr/bin/geoiplookup
/usr/bin/geoiplookup6
/usr/bin/geoipupdate
/usr/lib64/libGeoIP.So.1
/usr/lib64/libGeoIP.So.1.Five.Zero
/usr/lib64/libGeoIPUpdate.So.Zero
/usr/lib64/libGeoIPUpdate.So.Zero.Zero.Zero
/usr/percentage/GeoIP
/usr/percentage/GeoIP/GeoIP-preliminary.Dat
/usr/percentage/GeoIP/GeoIP.Dat
/usr/proportion/GeoIP/GeoIPASNum.Dat
/usr/percentage/GeoIP/GeoIPASNumv6.Dat
/usr/proportion/GeoIP/GeoIPCity.Dat
/usr/share/GeoIP/GeoIPCityv6.Dat
/usr/proportion/GeoIP/GeoIPCountry.Dat
/usr/percentage/GeoIP/GeoIPCountryv6.Dat
/usr/percentage/GeoIP/GeoIPv6-initial.Dat
...
Five) How to list recently set up RPM packages
We can use -qa choice with --ultimate, It will list all the recently established rpm programs.

$ sudo rpm -qa --remaining
output
GeoIP-1.5.Zero-11.El7.X86_64                     Sat 01 Sep 2018 11:34:09 AM UTC
wget-1.14-15.El7_4.1.X86_64                   Sun 26 Aug 2018 03:21:02 PM UTC
iwl7265-firmware-22.Zero.7.0-sixty two.2.El7_5.Noarch   Thu sixteen Aug 2018 02:10:18 PM UTC
libgomp-four.Eight.Five-28.El7_5.1.X86_64               Thu 16 Aug 2018 02:10:15 PM UTC
iwl2030-firmware-18.168.6.1-62.2.El7_5.Noarch Thu sixteen Aug 2018 02:10:15 PM UTC
iptables-1.4.21-24.1.El7_5.X86_64             Thu 16 Aug 2018 02:10:15 PM UTC
yum-plugin-fastestmirror-1.1.31-46.El7_5.Noarch Thu sixteen Aug 2018 02:10:14 PM UTC
iwl6000-firmware-nine.221.Four.1-sixty two.2.El7_5.Noarch  Thu sixteen Aug 2018 02:10:14 PM UTC
iwl4965-firmware-228.Sixty one.2.24-sixty two.2.El7_5.Noarch Thu 16 Aug 2018 02:10:14 PM UTC
iwl105-firmware-18.168.6.1-62.2.El7_5.Noarch  Thu sixteen Aug 2018 02:10:14 PM UTC
iwl100-firmware-39.31.Five.1-sixty two.2.El7_5.Noarch   Thu 16 Aug 2018 02:10:13 PM UTC
iwl1000-firmware-39.31.Five.1-sixty two.2.El7_5.Noarch  Thu 16 Aug 2018 02:10:thirteen PM UTC
ca-certificate-2018.2.22-70.0.El7_5.Noarch   Thu 16 Aug 2018 02:10:13 PM UTC
iwl6000g2b-firmware-17.168.Five.2-62.2.El7_5.Noarch Thu 16 Aug 2018 02:10:12 PM UTC
...
6) How to install RPM package without dependencies
We can use -ivh parameters with --nodeps stands for no dependencies check, To set up a specific package with out dependencies, As shown under.

$ sudo rpm -ivh --nodeps GeoIP-1.Five.0-11.El7.X86_64.Rpm
    Output
    Preparing...                          ################################# [100%]
        package deal GeoIP-1.5.0-eleven.El7.X86_64 is already set up
7) How to update RPM bundle hooked up
We can use -ivh --replacepkgs parameters to replace a selected bundle installed as proven under.

$ sudo rpm -ivh --replacepkgs GeoIP-1.Five.Zero-11.El7.X86_64.Rpm
    Output
    Preparing...                          ################################# [100%]
    Updating / putting in...
      1:GeoIP-1.Five.0-11.El7               ################################# [100%]
Remove
eight) How to uninstall RPM bundle
We can use -e parameters to uninstall unique bundle mounted without dependencies (don't test dependencies) as shown under.

$ sudo  rpm -e --nodeps GeoIP
Now type command underneath to make sure the GeoIP now not installed.

$ sudo rpm -q GeoIP
    Output
    package GeoIP isn't always hooked up
Upgrade
9) How to upgrade RPM package deal installed
We can use -Uvh parameters to upgrade a particular package deal installed as shown beneath.

$ sudo rpm -Uvh GeoIP-1.Five.Zero-11.El7.X86_64.Rpm
    Output
    Preparing...                          ################################# [100%]
        bundle GeoIP-1.Five.0-eleven.El7.X86_64 is already installed
Query
10) How to query all hooked up package
We can use -a parameters together with q to question all established packages on the server as proven beneath.

$ sudo rpm -qa
    Output
    python-firewall-0.4.4.4-14.El7.Noarch
    ncurses-base-5.9-14.20130511.El7_4.Noarch
    plymouth-0.Eight.9-zero.31.20140113.El7.Centos.X86_64
    kbd-misc-1.15.5-thirteen.El7.Noarch
    vim-not unusual-7.4.160-four.El7.X86_64
    bash-four.2.Forty six-30.El7.X86_64
    dmidecode-three.Zero-5.El7.X86_64
    filesystem-3.2-25.El7.X86_64
    kbd-1.15.5-thirteen.El7.X86_64
    vim-more desirable-7.Four.One hundred sixty-4.El7.X86_64
    firewalld-zero.4.Four.Four-14.El7.Noarch
    ....
11) How to question unique bundle
We can use grep command to locate approximately a particular package is hooked up or not as proven below grep GeoIP
    Output
    GeoIP-1.Five.Zero-11.El7.X86_64
12) How to question a document that belongs which RPM Package
In example quantity 9 we type command to list all files of an hooked up RPM package deal, Now we need to understand /usr/lib64/libGeoIP.So.1.5.Zero document belongs which RPM Package.

$ sudo rpm -qf /usr/lib64/libGeoIP.So.1.Five.Zero
output
GeoIP-1.Five.0-11.El7.X86_64
Verify
13) How to get records for a specific package
We can use -i parameters at the side of q to get records for a selected bundle as proven below.

$ sudo rpm -qi GeoIP
Output
Name        : GeoIP
Version     : 1.Five.0
Release     : 11.El7
Architecture: x86_64
Install Date: Thu sixteen Aug 2018 02:04:09 PM UTC
Group       : Development/Libraries
Size        : 2905020
License     : LGPLv2+ and GPLv2+ and CC-BY-SA
Signature   : RSA/SHA256, Sun 20 Nov 2016 05:forty nine:19 PM UTC, Key ID 24c6a8a7f4a80eb5
Source RPM  : GeoIP-1.Five.Zero-eleven.El7.Src.Rpm
Build Date  : Sat 05 Nov 2016 08:29:17 PM UTC
Build Host  : worker1.Bsys.Centos.Org
Relocations : (no longer relocatable)
Packager    : CentOS BuildSystem
Vendor      : CentOS
URL         : http://www.Maxmind.Com/app/c
Summary     : Library for u . S . A ./metropolis/company to IP cope with or hostname mapping
Description :
GeoIP is a C library that allows the person to discover the u . S . A . That any IP
deal with or hostname originates from. It makes use of a file primarily based database this is
correct as of June 2007 and might optionally be updated on a weekly
foundation via installing the GeoIP-update bundle. This database actually carries IP
blocks as keys, and countries as values. This database need to be extra whole
and accurate than using reverse DNS lookups.

This package deal includes GeoLite statistics created by means of MaxMind, available from http://www.Maxmind.Com/
14) How to verify a RPM package deal
We can confirm a package deal through evaluating records of installed files of the package deal to the rpm database, By the usage of -Vp choice (verify package).

$ sudo rpm -Vp GeoIP-1.Five.Zero-eleven.El7.X86_64.Rpm
15) How to verify all RPM packages
We can confirm all of the hooked up rpm applications, By using -Va choice (verify all).

$ sudo rpm -Va
output
S.5....T.  C /and so on/sysconfig/authconfig
S.Five....T.  C /and so on/yum.Repos.D/CentOS-Base.Repo
.M.......  C /and many others/machine-identification
.M.......  G /etc/udev/hwdb.Bin
.M.......  G /var/lib/systemd/random-seed
.M.......  C /and so on/shadow
S.5....T.  C /and many others/ssh/sshd_config
.M.......  C /and many others/audit/rules.D/audit.Policies
S.Five....T.  C /etc/NetworkManager/NetworkManager.Conf
....L....  C /and many others/pam.D/fingerprint-auth
....L....  C /and many others/pam.D/password-auth
....L....  C /etc/pam.D/postlogin
...