Defindit Docs and Howto Home

This page last modified: Dec 25 2006
keywords:rpm,yum,hang,stop,strace,pubkeys,can,not,stop,control,c
description:What to do when yum hangs because rpm is hanging.
title:Rebuild an rpm database when rpm (and yum) hang.


http://www.rpm.org/hintskinks/repairdb-2003-06/

Here is a session transcript:

[root@zeus ~]# cd /var/lib
[root@zeus lib]# tar czvf /tmp/rpmdb.tar.gz rpm
rpm/
rpm/Requireversion
rpm/Providename
rpm/__db.002
rpm/Packages
rpm/Sigmd5
rpm/Sha1header
rpm/__db.003
rpm/Basenames
rpm/__db.001
rpm/Triggername
rpm/__db.000
rpm/Filemd5s
rpm/Installtid
rpm/Conflictname
rpm/Name
rpm/Requirename
rpm/Provideversion
rpm/Pubkeys
rpm/Group
rpm/Dirnames
[root@zeus lib]# cd /var/lib/rpm
[root@zeus rpm]# ls
Basenames     __db.001  Dirnames  Installtid  Providename     Requirename     Sigmd5
Conflictname  __db.002  Filemd5s  Name        Provideversion  Requireversion  Triggername
__db.000      __db.003  Group     Packages    Pubkeys         Sha1header
[root@zeus rpm]# rm -f __db*
[root@zeus rpm]# rpm --rebuilddb -vv
D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.5588
D: creating directory /var/lib/rpmrebuilddb.5588
D: opening old database with dbapi 3
...