Adventures In Tech

Icon

A technology blog by Ross Macduff

Problem upgrading rpm package

Found a couple of new tools for Redhat boxes.  Here’s the story about how I came across them.

dbus-devel needed to be updated on a RHEL 5 box but when I tried to do a yum update things would bail out towards the end of the process with:

Error unpacking rpm package dbus-devel-1.1.2-12.el5.i386
error: unpacking of archive failed: cpio: lstat

Googling for similar unpacking/cpio errors showed that this was not uncommon.  In most cases it is because of  some funkiness with a directory that needs to be written to during unpacking. I initially tried to debug the issue with strace, but thought there must be an easier way.

The next thing I did was remove the offending package and try to re-install it with:

rpm -e --nodeps dbus-devel
yum install dbus-devel

This got me nowhere.  Knowing that there might be some messed up folder that needed to be unpacked to I wanted to see what files and folders dbus-devel created.   The command for this is

rpm -qpl <package.rpm>

But of course I didn’t have the rpm sitting around and I didn’t feel like going to the RedHat Network to fetch it. This is where the yum plugin yum-downloadonly comes in handy. This can be installed with

yum install yum-downloadonly

This gives the added options to yum:

--downloadonly
--downloaddir==/path/to/pkg

Now you can download the rpm without installing it. With this I could check out what files and directories dbus-devel wanted to add. I went through these one-by-one checking them out and removing them (making sure the directories were not referenced by another package: rpm -qf /path/to/dir). I did find the culprit: the directory /usr/share/devhelp had become corrupted so dbus-devel could not unpack there. I removed that directory and dbus-devel installed perfectly after that.

Afterwards I found another set of tool that allows one to download rpms from a repository: yumdownloader. It’s a part of the yum-utils package (yum install yum-utils). This nice thing about this one is that it allows you to download src.rpms too.

References:

1. http://www.cyberciti.biz/faq/yum-downloadonly-plugin/

Update 2009-03-13: To retrieve a pacakge (that has been installed) another option is to configure yum to cache headers and packages.  In yum.conf set keepcache=1, then look in /var/cache/yum for the package.

About these ads

Filed under: redhat, rpm, Sysadmin, yum

One Response

  1. [...] downloading src rpms from RHN I mentioed in a previous post how cool it was that you can download src rpms with yumdownloader.   I didn’t realize until [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: