June 12, 2011

RPM Commands

RPM package is a powerful utility to manage the software in all major Linux distributions.Â¬â  RPMs can be used to,

  • Install packages
  • Remove packages
  • Upgrade packages
  • Verify packages

Here are some useful command to manage RPM packages,


1. Getting detailed information about the package httpd

rpm -qi httpd

2. Determining which package installed the file /etc/httpd/conf.d/httpd-portal.conf,

rpm -qf /etc/httpd/conf.d/httpd-portal.conf

3. Showing all the files installed my httpd

rpm -ql httpd

4. Viewing the documentation files for the command httpd,

rpm -qd httpd

5. Listing all files included in an rpm file,

rpm -qpl /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm

6. Verify if the package is installed or not,

rpm -qa | grep httpd

7. To check what has changed in the files on the system since the HTTPD rpm originally installed,

rpm -V httpd

8. Checking package to ensure its integrity and origin: (NOTE: gpg or pgp software must be installed on your system before you use this command)

rpm -K /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm

9. To install wget RPM package,

rpm -ivh /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm

10. Upgrading the package wget: (NOTE: if the package is not installed it will install it for You, like option “-ivh”),

rpm -Uvh /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm

11. Upgrade the package wget (if it exists already),

rpm -Fvh /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm

12. Removing the RPM package wget,

rpm -e wget

13. To list the configuration file of a package,

rpm -qc httpd

14. To display the list of all recently installed packages,

rpm -qa –last

15. To find out what dependencies httpd package has,

rpm -qR httpd

16. To find out what dependencies an rpm file has,

rpm -qpR /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm

17.Â¬â  To display list of configuration files for a command,

rpm -qcf /usr/sbin/httpd

Click Here!