1

Sometimes rpmdb gets corrupted, usually due to some process dying. The fix is quite easy, simply run rpm --rebuilddb, maybe remove the lock and some other files.

My question is, is there any way to check if the rpmdb is corrupted or not before trying to use it?

Just to give some context, I am managing multiple machines and sometimes rpmdb gets corrupted - i'm looking for a simple way to check.

1 Answer 1

4

/usr/lib/rpm/rpmdb_verify should be the tool you are looking for.

$ /usr/lib/rpm/rpmdb_verify /var/lib/rpm/Packages 
BDB5105 Verification of /var/lib/rpm/Packages succeeded.

Or with -q option:

$ /usr/lib/rpm/rpmdb_verify -q /var/lib/rpm/Packages
$ echo $?
0
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .