I stumbled upon this error a few days ago on some cPanel server. When checking cpanel’s error log, this was found:
STDERR: error: rpmdb: BDB0113 Thread/process 14329/139871898372160 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
error: rpmdb: BDB0113 Thread/process 14329/139871898372160 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages database in /var/lib/rpm
It seems there is an error with rpm database. There is a simple fix. Remove all db files from your rpm directory and rebuild the database:
rm -f /var/lib/rpm/__db*
db_verify /var/lib/rpm/Packages
rpm --rebuilddb
yum clean all
Now you’ll be able to login.