Knowledgebase
Fix rpmdb: Thread died in Berkeley DB library
Posted by Neil McNulty on 18 April 2025 11:49 AM

When you get the following RPMDB Open Failed Error message or if you see rpmdb errors during package management (during yum/rpm operations), like this:

rpmdb: Thread/process 277623/140429100390144 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
CRITICAL:yum.verbose.cli.yumcompletets:Yum Error: Error: rpmdb open failed

It means that the RPM Database on your VPS is corrupted. It is typical on CloudLinux 6-8 for this to happen. To fix the problem, complete the following steps:

mkdir /var/lib/rpm/backup 
cp -a /var/lib/rpm/__db* /var/lib/rpm/backup/
rm -f /var/lib/rpm/__db.[0-9][0-9]*
rpm --quiet -qa
rpm --rebuilddb
yum clean all

If the command "rm -f /var/lib/rpm/__db.[0-9][0-9]*" shows an error "could not delete database at /var/lib/rpmold....." then run the command "rm -f /var/lib/rpm/__db.*"

(0 vote(s))
Helpful
Not helpful