I got an odd error today when trying to upgrade webmin on one of our web servers. When rpm ran we got a pile of errors including the message “rpmdb: fatal region error detected; run recovery” .
Running rpm –rebuilddb produced the same error.
Anyway after much screwing around and useless searches in linux mail lists I found a liitle gem on the page “Repair a RPM database safely” on the http://www.rpm.org site.
Basically it says:-
“hangs” in select are usually stale locks. Fix by doing
cd /var/lib/rpm
rm -f /var/lib/rpm/__db*
Turns out rpm –rebuilddb was failing due to an old lock file.