Monday, December 6, 2010

useful rpm commands and examples

#rpm -qa
Dumps all installed packages

#rpm -qi httpd
Dumps information about httpd package

#rpm -qf /usr/bin/httpd
Dumps package membership info for file httpd

#rpm -qpi <url>
Shows package info prior to installation

#rpm -Va
Verifies all packages on the system ,returning info only if there are any discrepencies from the original installation

Verfy httpd package for any discrepencies
#rpm -Vf /usr/bin/httpd
SM5 .... T /usr/bin/httpd
Abbreviations  (SM5)
(file size), M (mode or permissions), 5 (MD5), T (mod time)


#rpm -Vp <url>
Verify the remote package in the internet

Installation


rpm -ivh  <rpm filename>

  • Does not override previous package
  • use this method to install a new version of the kernel
Upgrade (installs or overrides existing package)
#rpm -Uvh  <package name>

Freshen (updates an existing package)
Note: Will not install the package ,if it doesn't exist locally
#rpm -Fvh *.rpm  - Freshens the current version of a package


Package Removal
#rpm -evh *.rpm - removes a package
Note :  Removal process considers dependendies  and will complain if the removal will break one or more packages.To get around this,use 
#rpm -ev --nodeps *.rpm

0 comments: