Novell Home

Useful RPM Commands

Novell Cool Solutions: Tip
By Maer Melo

Digg This - Slashdot This

Posted: 16 Nov 2007
 

RPM package is a powerful utility for managing the software packages of major Linux distributions. RPM can be used to install and remove software packages, update packages and get an overview of all installed packages.

Here are some useful commands to manipulate RPM packages:

== Query / Verify commands

  1. Getting detailed information about the package wget:
    rpm -qi wget

  2. Determining which package installed the file /usr/bin/wget:
    rpm -qf /usr/bin/wget

  3. Showing all the files installed by the package wget:
    rpm -ql wget

  4. Viewing the documentation files for the command wget:
    rpm -qd wget

  5. Listing all files included in the not yet installed package wget by entering the following:
    rpm -qpl /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm

  6. Listing all files included in the installed package wget:
    rpm -ql wget

  7. Verifying that a package is no longer installed by entering:
    rpm -qa | grep wget

  8. Seeing what has changed in the files on your hard drive since the wget RPM was originally installed by entering the following:
    rpm -V wget

  9. 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

== Install / Uninstall / Upgrade commands

  1. Installing the package wget:
    rpm -ivh /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm

  2. Uninstalling the package wget:
    rpm -e wget

  3. 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

  4. Extracting RPM file using rpm2cpio and cpio command: (NOTE: RPM content will be extracted the current directory)
    rpm2cpio wget-1.10.2-78.i586.rpm | cpio -idmv


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell