dealing with RPM

RPM is the Red Hat Package Manager. It is a way of bundling files together into packages for distribution. I have found it to be both a blessing and a curse. It is wonderful when a package can simply be handled as an opaque blob, independent of other opaque blobs. The trouble starts when there are package interdependencies or when it is necessary to get inside the blob.

Most of the time you don't deal with RPM directly and instead use yum, which is a higher level tool. This is good.

One of my main sources of confusion used to be thinking of RPM in the same way as I think of tar. The big difference is that RPM deals with a central database as well as with the rpm file, and it is not always clear which is being interrogated and the like. An RPM package is kept in cpio archive format, which is a fact you may find useful if you want to do some real hacking, but you would probably be way off track if you took that approach.

Getting information about package

Finding out what version of a package is installed:

rpm -q bittorrent

Finding out lots of cool stuff about an installed package:

rpm -qi bittorrent

finding out what rpm owns a file:

 $  rpm -qf `which syslogd`
sysklogd-1.3.31-17

Finding out what files are inside of an rpm:

 $  rpm -qlp sysklogd-1.3.31-17.rpm

In general the -p switch tells rpm to look at a package file instead of getting info from the database:

rpm -qRp xx.rpm ---finds out what a package requires.
rpm -qp --provides yy.rpm ---finds out what a package provides.

Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org