Sharing Knowledge | System Admin Articles

Quick HOWTO : Redhat Package Management (RPM)



Folks, Here is Quick Reference and HOWTO for RPM (Redhat Package Management). Hope it will be useful..


 Features:
  1. Provides package management
   a. Query
   b. Install
   c. Uninstall
   d. Upgrade
   e. Verify
  2. Auto-verifies packages using GPG, MD5, SHA1SUMs
  3. Automatically reports on unresolved dependencies




Install (Does NOT overwrite previous package):
Note: Use this method to install a new version of the kernel
  1. rpm -ivh *.rpm
  2. rpm -ivh http://192.168.75.100/RH5/i386/Server/dhcp-3.0.5-7.el5.i386.rpm



Upgrade (Installs or overwrites existing package):
  1. rpm -Uvh *.rpm
  2. rpm -Uvh http://192.168.75.100/RH5/i386/Server/dhcp-3.0.5-7.el5.i386.rpm

Freshen (Updates an existing package):
Note: Will NOT install the package, if it doesn't exist locally

  1. rpm -Fvh *.rpm - freshens the current version of a package


Removal:
 1. rpm -ev *.rpm - removes a pacakge
Note: removal process considers dependencies and will complain if the removal will break 1 or more packages. To get around this, use '--nodeps' option with 'rpm -ev --nodeps *.rpm'

 2. rpm -ev gftp


Query:


  1. rpm -qa - shows all installed packages
  2. rpm -qa | wc -l - this dumps all packages and provides a count
  3. rpm -qa | grep -i sendmail
  4. rpm -qi nano - dumps info. about the 'sendmail' package as it's recorded in the local RPM database
  5. rpm -qf /usr/bin/nano - dumps package membership info. for the 'nano' file
  6. rpm -qpi http://192.168.75.100/RH5/i386/Server/dhcp-3.0.5-7.el5.i386.rpm - dumps info. about the uninstalled 'dhcp' package, which resides on the repository
  7. rpm -ql package_name - returns all included files


Verify:
  1. rpm -Va - verifies ALL packages on the system, returning info. only if there are discrepancies from the original installation

  2. rpm -Vf /usr/bin/nano

Task: Change '/usr/bin/nano' then verify

SM5....T   /usr/bin/nano

S(file size), M(mode or permissions), 5(MD5), T(mod time)
  3. rpm -Vp nano


Labels: Linux, Quick HOWTO

My Profile PhotoAbout the Author

I'm Parthiban, An UNIX System Admin by Profession. I'm Experienced in Linux/Unix System Administration and Scripting. I have done lot of work on the infrastructure Mgmt side in Linux, UNIX and Windows system administration, Hardware, Storage and Data center. I'm blogging since 2008.
Follow Me On Twitter or On Facebook

0 Comments for "Quick HOWTO : Redhat Package Management (RPM)"

What do you think about this Article? Add your Opinion..!

Back To Top