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!!

3 comments:

Christopher Friedt said...

Ok - maybe I should only be blaming YUM above - it seems that it didn't automatically update it's headers from my repository after I updated the repository - strange?

I had to delete the header file manually on my target machine in order for this install to work.

My confidence has been somewhat restored in RPM.

Nathan said...

hear hear..

although there is the lesser known --aid tag that will fill dependencies IF you happen to be in a directory that contains all the dependencies of that file.

Still sounds like the redundancy office of redundancy.

Anonymous said...

yum clean all

fixed this for me...

but yeah, took a long time to figure it out!