SUSE Conversations

Useful RPM Commands

By: salal

November 16, 2007 10:10 am




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


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


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


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


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


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


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


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


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


  1. Uninstalling the package wget:
    rpm -e wget


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


  1. 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
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: ,
Categories: Enterprise Linux, SUSE Linux Enterprise Server, Technical Solutions

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.