This article discusses how to resolve "rpmdb Failed: Thread died in Berkely DB library" error on Linux server.
Steps to Reproduce
This error might output during dnf operations or any rpm operations on Linux - based operating system:
# dnf -y update rpmdb: Thread/process 1339895/140650362885888 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.main: Error: rpmdb open failed
How to Resolve "rpmdb Failed: Thread died in Berkely DB library"
The error above means your rpm database is corrupted and will block you from running any dnf or rpm operations. To solve this issue, simply run the steps below to backup and rebuild the rpm database:
- Run backup for the current rpm databases by creating a new directory for the current rpm databases backup. Copy the current files to the backup directory:
mkdir /var/lib/rpm/backup cp -a /var/lib/rpm/__db* /var/lib/rpm/backup/
- Remove the current rpm database files and rebuild the database with the following commands:
rm -f /var/lib/rpm/__db.[0-9][0-9]* rpm --quiet -qa rpm --rebuilddb
yum clean all - Rebuild complete!
You may now reattempt your previous command to verify that the issue is resolved.
Conclusion
You now know how to resolve "rpmdb Failed: Thread died in Berkely DB library" error.

👀 Choose SSD-powered VPS servers for increased speed, power, and security! Now 50% off- starting from only $3.19/mo.