rpm Command Examples

– To install rpm package
# rpm -ivh pidgin-2.7.9-5.el6.2.i686.rpm

Preparing…         ########################### [100%]
1:pidgin               ########################### [100%]

– To List all files of an installed RPM package
# rpm -ql BitTorrent

– To List Recently Installed RPM Packages
#  rpm -qa –last

– To Upgrade a RPM Package
# rpm -Uvh nx-3.5.0-2.el6.centos.i686.rpm

– To Remove a RPM Package
#  rpm -evv nx

– Get the Information of RPM Package Before Installing
# rpm -qip sqlbuddy-1.3.3-1.noarch.rpm

– To Import an RPM GPG key
# rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

– To List all Imported RPM GPG keys
# rpm -qa gpg-pubkey*

– To see the packages under any group
# rpm -qg “System Environment/Shells”

– To check dependencies
# rpm -qpR BitTorrent-5.2.2-1-Python2.4.noarch.rpm

– To check an Installed RPM Package
# rpm -q BitTorrent

– To Verify a RPM Package
# rpm -Vp sqlbuddy-1.3.3-1.noarch.rpm

– To verify all RPM Packages
# rpm -Va

– To check all the changed files
# rpm -q –changelog bash

– To se most recently installed packages
# rpm -qa –last | head

– Getting Information on Package Files
# rpm -qpc qt-4.6.2-17.fc12.x86_64.rpm 

– Querying Package Files Remotely
# rpm -qp ftp://username:password@hostname:port/path/to/rpm/file
# rpm -qp http://hostname:port/path/to/rpm/file

– We can verify the rpm file for its consistency.
# rpm –verify –file /bin/ls
# rpm –verify -p samba-3.4.5….rpm

Following are the list of failure codes
5 – MD5 checksum
S – File size
L – Symbolic link
T – File modification time
D – Device
U – User
G – Group
M – Mode

– Always check the PGP signature of packages before installing them on your Linux systems and make sure its integrity and origin is OK.
# rpm –checksig pidgin-2.7.9-5.el6.2.i686.rpm
————————————————————————————–
pidgin-2.7.9-5.el6.2.i686.rpm: rsa sha1 (md5) pgp md5 OK
————————————————————————————–

————————————————————————————————————————————————–
We request and encourage you to leave a comment or share if you have more information / examples so as to keep this blog more informative, to benefit everyone of us.
————————————————————————————————————————————————–

Leave a Reply

Your email address will not be published. Required fields are marked *