20070612

RPM & YUM - and why they still suck

I used to use Redhat Linux quite a long time ago - maybe in 1996 - but I was soon after persuaded to switch to Slackware Linux. Why? Redhat's package management system, RPM, is a piece of crap.

What I used to hate about RPM a long, long, time ago:

  1. "Dependency Hell", as it is so dearly termed by many Redhat users, is when one is unable to install a package because of the exponential number of dependency packages that are necessary. The simplest way to avoid this is with the "nodep" option, but then missing dependencies become horribly difficult to trace.

  2. The inability to optimize or select which dependencies (--configure options) will actually be present on your system. For example, --without-alsa / --with-oss . The simple answer is - support everything, except what Redhat doesn't want to, and make the dependency tree static. This could easily be worked around by compiling all of your own sources from scratch and populating your own RPM repository, but then that defeats the purpose of RPM in the first place, unless you're intending on releasing a new distro or creating a kickstart script so that the Redhat install CD would pull rpm's from a specific location.
I couldn't really blame Redhat at the beginning, because they were basically the first large-scale commercial Linux distribution around, and they've probably brought more to Linux than any other Linux distribution, aside from Debian maybe.

Now though, I feel as though I can blame them. The complaints that I have, are still basically the same. After over 10 years, there has been no evolution with RPM aside from this lovely thing called yum which sorts out dependencies and retrieves files as necessary.

I'm currently packaging the sun jdk, naturally without source code so that i comply with Sun's BCL or whatever. When I built this RPM and tried to install it with RPM, i got an error saying:

Error: Missing Dependency: libodbc.so is needed by package jdk
Error: Missing Dependency: libodbcinst.so is needed by package jdk

After some amount of frustration and searching incoherent sites for documentation on .spec file creation (required for building RPM's) I found the following option, which I thought was like the heavens opening up. I now quote from http://www.rpm.org/max-rpm-snapshot/s1-rpm-depend-auto-depend.html, which seems to be as authoritative a site on .spec file creation as any.

The autoreqprov, autoreq, and autoprov Tags — Disable Automatic Dependency Processing

There may be times when RPM's automatic dependency processing is not desired. In these cases, the autoreqprov, autoreq, and autoprov tags may be used to disable it. This tag takes a yes/no or 0/1 value. For example, to disable automatic dependency processing, the following line may be used:

AutoReqProv: no

The autoreq and autoprov tags can be used to disable automatic processing of requirements or "provides" only, respectively.

After inserting this magical line into my .spec file, and packaging the file without any issues, even installing the rpm file, without any issues, yum still provides me with the fantastic error code above, even when the rpm itself says that it has no dependencies.

Go team!!