How to solve “Error: rpmdb open failed” error in CentOS

Modified on Wed, 13 Oct 2021 at 08:37 PM

When using yum on CentOS, you might get something like Error: rpmdb open failed. A similar error like this can be shown:

yum clean all
error: rpmdb: BDB0113 Thread/process 2921108/140151702521664 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

This means that your yum repository is corrupted. To fix this, we need to clean out the local yum database:

mv /var/lib/rpm/__db* /tmp
yum clean all

Now run the yum command again, e.g.:

yum update
Loaded plugins: fastestmirror, rhnplugin
This system is receiving updates from CLN.
Determining fastest mirrors

If all goes well, remove the old database:

rm -rf /tmp/__db*

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article