This error might output during yum operations or any rpm operations on Linux - based operating system:

# yum -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


The error above means your rpm database is corrupted and will block you to run any yum or rpm operations. To solve this issue, simply run the steps below to backup and rebuild the rpm database:

1. 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/

 

2.  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

 

3. Rebuild complete! You may trying running the yum command once again and see if the issue has resolved.

 

Was this answer helpful? 55 Users Found This Useful (130 Votes)