Rebuild Corrupt Yum RPM Database

When installing packages via yum and the database is corrupt, the following message is displayed:

rpmdb: Thread/process 13903/140194607871904 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

Commands such as “yum clean all” also fail with this message.  To correct, move the RPM DB files to a temporary folder and rebuild the database with these 3 commands:

# mv /var/lib/rpm/__* ~
# rpm --rebuilddb
# rpm -qa | wc -l

If successful, it is safe to delete the __* files from your temporary folder.


Was this helpful?

1 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.