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.