Friday, October 31, 2014

Linux RPM database recovery

Sometimes you may get error message when you do yum list/yum install/yum clean like the following:
[root@pool-02 home]# yum list
rpmdb: Thread/process 2417/139877686400768 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
Or a message like: 
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbenv->open: DB_RUNRECOVERY 
It's because the rpm db is corrupted. A quick fix is issuing the following command: 
rm -f /var/lib/rpm/_*
rpm --rebuilddb 


Post a Comment

<< Home