Recovering Corrupt RPM DB

I had a support specialist today that had an open yum task they couldn’t kill gracefully, after kill -9, this was happening

[[email protected] home]# yum list | grep -i xml
rpmdb: Thread/process 31902/140347322918656 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
Error: rpmdb open failed
[[email protected] home]#

The solution to fix this is to manually erase the yumdb and to manually rebuild it;

[[email protected] home]# rm -f /var/lib/rpm/__*
[[email protected] home]# rpm --rebuilddb

Leave a Reply

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