fir3net
PPS-Firenetbanner-780.5x190-30-03-17

Yum Error - Thread died in Berkeley DB library ... Error: rpmdb open failed)

Issue

When executing Yum you receive the following error,

[root@william-gce blog]# yum install npm
rpmdb: Thread/process 3934/139752225695488 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

Solution

This can be caused by a corrupted rpm db. To fix delete the __db* files and then run rpm --rebuilddb. Heres an example,

[root@william-gce blog]# rm -f /var/lib/rpm/__*
[root@william-gce blog]# rpm --rebuilddb

 You will now be able to execute Yum.

[root@william-gce blog]# yum install npm
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: centos.vwtonline.net
* epel: mirror.symnds.com
* extras: mirror.5ninesolutions.com
* updates: linux.cc.lehigh.edu
* webtatic: us-east.repo.webtatic.com

Tags: Yum, Linux

About the Author

RDonato

R Donato

Ricky Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Ricky on Twitter @f3lix001