[CentOS] yum hangs when Reading Local RPMDB

Thu Jan 10 15:06:19 UTC 2008
David G. Miller <dave at davenjudy.org>

Kai Schaetzl <maillists at conactive.com> wrote:

> All of a sudden yum hangs on a Centos 4.5 (updated to the latest patch 
> before 4.6) when I try to use it. "clean metadata" didn't help.
> The output of -d5 shows it gets to the point of "Reading Local RPMDB" and 
> then sits there. The process doesn't die, but doesn't seem to do anything 
> from that point on. strace shows this: futex(0xb76dcae8, FUTEX_WAIT, 2, 
> NULL
>
> I remember that futex hangs have been mentioned in the past when doing 
> "big" updates from 4.x to 4.y, but this wasn't the case here.
> python-2.3.4-14.4
> python-sqlite-1.1.7-1.2.1
> sqlite-3.3.6-2
> yum-2.4.3-3.el4.centos
> Kernel in use is not the latest 4.5 kernel, but one from 4.3. This 
> shouldn't matter in this case, shouldn't it?
>
> How can I resolve this?
> I see that one suggestion is rm /var/lib/rpm/__db*. How do I rebuild it 
> then?
> I found that cleaning the metadata doesn't remove the sqlite databases, so 
> I removed these from /var/yum/cache as well. The rebuilt databases were 
> different, but it didn't solve the problem.
>
>
> Kai
 From the rpm man page:

   REBUILD DATABASE OPTIONS
       The general form of an rpm rebuild database command is

       rpm {--initdb|--rebuilddb} [-v] [--dbpath DIRECTORY] [--root 
DIRECTORY]

       Use --initdb to create a new database, use --rebuilddb to rebuild 
the  database  indices  from  the  installed
       package headers.

Remove the __db* files and then "rpm --rebuilddb" is usually sufficient 
unless you have non-standard locations for the database.

Cheers,
Dave

-- 
Politics, n. Strife of interests masquerading as a contest of principles.
-- Ambrose Bierce