« Aqua Teen Hunger Force Remixed: The Luxembourg Infernal Coffin Scare. | Main | Fedora Core 6 »

rpm -e kernel-devel: scalability matters.

I'm running Fedora Core on my laptop. One of the habits of that distribution is to install the kernel du jour as part of the usual upgrade process, and to let old ones stick around -- including the kernel-devel packages which tend to have a lot of files with precisely the same names.

After a year or two, trying to remove some old kernel-devel packages will lead to a nasty surprise: rpm needs 1G of memory. My laptop doesn't have that.

Turns out that rpm doesn't deal particularly well with lots of files in lots of packages that have the same or almost the same name. For that reason, there's a list of directories where rpm gets sloppy about checking for duplicates; /usr/src is among them. Unfortunately, this sloppiness leads to loss of files during upgrades. Therefore, some bright engineer decided to deactivate the sloppiness when packages are removed. The result: 1GB of virtal memory is needed to clean up the kernel-devel packages.

There doesn't seem to be a clean work-around -- except possibly in the latest "forked" rpm. My way out of this mess was to download the sources for rpm, disable patch #12 ("exclude") in the spec file, rebuild, and then run rpm using the newly-built instances of librpm and librpmdb. I got rid of the kernel-devel packages quickly, and continue to use the "usual" instance of rpm for everyday purposes.

Thanks for the folks on #rpm for their help!

Still, this entire story points to several instances of rather poor engineering in rpm: The duplicate handling was implemented without any regard for memory consumption or efficiency; the workaround breaks upgrades; and the workaround to the workaround breaks removal of packages again.

Sometimes, I'd wish I was using a Debian-based system.

TrackBack

TrackBack URL for this entry:
http://log.does-not-exist.org/mt/mt-tb.cgi/1474

Comments (2)

Mace Moneta:
Why not remove them individually? for rpm in `rpm -q kernel-devel` do echo "Removing: $rpm" echo "rpm -e $rpm" | bash done
The memory hog effect occurs when trying to remove the things individually. That was the first thing I tried...

About

This page contains a single entry from the blog posted on March 10, 2007 4:14 PM.

The previous post in this blog was Aqua Teen Hunger Force Remixed: The Luxembourg Infernal Coffin Scare..

The next post in this blog is Fedora Core 6.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.35