You are here
Home > Redhat > Rpm Commands

Rpm Commands

1. Provides Package management
 

  • Query

  • Install

  • Uninstall

  • Upgrade

  • Verify

2. Auto Verifies package using GPG MD5 SHA1 SUM5

Query

1. # rpm -qa                – It shows all Installed Packages

2. # rpm -qa | wc -l      -It counts installed packages and gives the output

3. Try few sample commands
 

  • # rpm -qa samba

  • # rpm -q samba
     
  • # rpm -qa | grep -I samba
     
  • # rpm -q samba*
     
  • # rpm -qi samba -It shows the info. About the samba Package
     
  • # which nano
     
  • # rpm -qf /usr/bin/nano- It shows package membership info for the nano file
     
  • # rpm -qpi http://<ipaddress>/pacakge name -It shows the info about the uninstalled package
     
  • # rpm -ql <package name> -it returns all included files
     
  • # rpm -q samba -i
     
  • # rpm -q samba -l

4. Verify

1. # rpm -Va – Verifies all packages on the system, returning info only if there are corruption from the original installation
 

  • # rpm -Vf /usr/bin/nano [ If output is nothing ]

  • # echo $? If it is displays 0 no error in that particular package
     

5. Install [ It does not overwrite previous package]
 

  • # rpm -ivh samba*.rpm

  • # rpm -ivh Http:// < server ip address> / File name
     

6. Upgrade [ Installs or overwrite existing Package]
 

  • Rpm –Uvh samba*.rpm

  • # rpm -Uvh Http:// < server ip address> / File name
     

7. Freshen ( Upgrades an existing Package. Note Will not install the package, if it does not exist locally)

  • # rpm -Fvh *.rpm – Freshen the current version of the package.

8. Unistall

  • # rpm -e < package name>
     

9. Package management GUI
 

  • Add/remove Software

  • # system-config-packages
     

Leave a Reply

18 + 9 =

Top