Saturday, April 28, 2007

Oops, I lost my rpmdb

Yesterday my computer started randomly rebooting when I was trying to install packages on my computer, so I booted from a live CD and ran resierfsck on my disk, which fixed a whole bunch of things. But now when I run rpm -qa I get a list of no packages - and running rpmdb --rebuilddb doesn't help. Fortunately smart query lists everything that is installed, so I'm pretty sure there must be some way to get the rpmdb back, but I can't find it. Help!


Christian González G. said...

Here on Fedora Core 6:

su -
cd /var/lib/rpm
rm -f __db.*
rpm --rebuilddb

More info (in Spanish):

Christian González G. said...

BTW, make backups of /var/lib/rpm before ;).

Roberto said...

Do you run SUSE?
I don't know recent versions, but older SUSE *did* perform a backup of the rpmdb, I'd say in the same directory... did you check?