[K12OSN] Corrupted RPM DB

Eric Harrison eharrison at mail.mesd.k12.or.us
Tue Apr 25 20:20:35 UTC 2006


Angus Carr wrote:
> Here's an odd one for the list:
> 
> I have a corrupted RPM DB. I think it's getting in the way of my yum
> updates.
> 
> RPM operations fail. All of them.
> 
> I decided to try to correct the problem, following
> http://www.rpm.org/hintskinks/repairdb
> rm  -f /var/lib/rpm/__db*
> rpm --rebuilddb
> 
> The rm works, but the rebuilt db does not. It ends up flashing garbage
> to the terminal.
> 
> Any clues or suggestions?
> 
> Angus Carr.
> 


There are a number of other suggestions further down on the link you
posted (http://www.rpm.org/hintskinks/repairdb).

First and foremost is backups. Do you have good backups? (you should!)
If so, restore /var/lib/rpm/ to a known good copy.

I have tested the dump & restore trick:

   cd /var/lib/rpm
   /usr/lib/rpm/rpmdb_verify Packages

If there are any errors, repair by doing

   mv Packages Packages-ORIG
   /usr/lib/rpm/rpmdb_dump Packages-ORIG | \
      /usr/lib/rpm/rpmdb_load Packages


-Eric




More information about the K12OSN mailing list