rpm: The Left-Hand Path

RPMs are a packaged file developed by RedHat inc. Although they are used by other distributions such as SuSE and Mandrake.

Installing RPMS

To install an RPM, you either have an easy and a hard way. I'll talk about the easy way later. Let's say that you have a nice new package and you want to see what it is about, so:

rpm -qip cowsay-1.1.0.rpm

You might get something back like:

Name        : cowsay                       Relocations: (not relocateable)
Version     : 1.1                               Vendor: [[MandrakeSoft]]
Release     : 6mdk                          Build Date: Thu 21 Aug 2003 19:05:41 BST
Install date: (not installed)               Build Host: klama.mandrake.org
Group       : Toys                          Source RPM: cowsay-3.03-6mdk.src.rpm
Size        : 30529                            License: Artistic and GPL
Packager    : Guillaume Rousse <guillomovitch@linux-mandrake.com>
URL         : http://www.nog.net/~tony/warez/cowsay.shtml
Summary     : Configurable talking cow
Description :
Funny program to create ASCII images like cows, sheeps and much more.

Ok. So you like the look of it, and you want to install it, but you're not sure if it is already on your system. This can be checked by:

 1. rpm -q cowsay-1.1.0

If that returns false (i.e. prints nothing to the console), then you can install it thus:

 1. rpm -i cowsay-1.1.0

But of course, what happens if you have dependencies? It is virtually impossible nowadays to find a package which does not depend on another. As far as I know, the rpm command should sort this out for you, but you can, on rare occassions, do:

 1. rpm -i --nodeps cowsay-1.1.0

THIS IS NOT RECOMMENDED THOUGH, since forcing the installed package will always lead to "dependency hell". This is where you find that other packages won't install properly because you don't have the dependencies from last time, etc. The result is always a cascading and cyclic one.

Deleting RPMs

Let's assume now that you're fed-up with the cowsay-1.1.0 package and you want to remove it. You can do so, thus:

 1. rpm -e cowsay-1.1.0

Easy. Disappeared. Gone. However, what that has done is that has probably left the dependencies behind, or it might say that if you try and remove the package then you might break dependencies. To circumvent that, you can do:

 1. rpm -e --nodeps cowsay-1.1.0

But I must warn you that --nodeps is strongly discouraged and MUST be used with caution.

Querying installed RPMs

You can see what your system has installed by doing:

# rpm -qa &lt;package name&gt;

Here I have used:

To narrow it down, do:

rpm -qa | grep -i &lt;keyword&gt;

Here, I am piping the result via grep which will search for the keyword specified.

If you want to see the packages you have and the size, you can make use of the queryformat parameter to rpm:

rpm -qa --queryformat "%{Size} %{name}\n"

You can then pipe this to sort then head or tail to get the largest packages installed.

Mandrake: urpmi

Redhat and Fedora: up2date

Fedora: yum

ManagingPackages/Rpm (last edited 2005-06-30 23:01:17 by 81)