Today I received an email from my server cron running on Apache CentOS 6.1:
Cron <[email protected]> /usr/bin/yum -y -R 120 -d 0 -e 0 update
rpmdb: Thread/process 4936/139915147442080 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30974)
error: cannot open Packages database in /var/lib/rpm
Error: rpmdb open failed
Basically you need to move your rpm db files to a tmp folder, then rebuild the database.
Fix the Yum Database Update Error
First, don’t panic. Log into your console and move the db files to your temp folder:
mv /var/lib/rpm/__db* /tmp
Run a rebuild
Clean up the leftovers
yum clean all
After this you should be back in business. The two tutorials I found do things in a different order. I tried the order above and it worked fine. The article on svenned.be says to “clean” then run “yum update”, while ma.ttias.be says to just rebuild and clean. I’m not sure the difference really, but the first option seemed to work for me. I ran a yum update afterwards and it said there was nothing to update, but the databases were back in place.