yum安装软件提示Error: rpmdb open failed
[root@oldboy_50 tmp]# yum list
rpmdb: Thread/process 9360/140235477935872 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
这个原因是因为RPM数据库被破坏
重建RPM数据库恢复正常
[root@oldboy_50 rpm]# cd /var/lib/rpm/
[root@oldboy_50 rpm]# for i in `ls | grep 'db.'`;do mv $i $i.bak;done #备份db.开头的文件
[root@oldboy_50 rpm]# rpm --rebuilddb #重建RPM数据库
[root@oldboy_50 rpm]# yum clean all #清除缓存
如果想了解因为什么这样做,访问阅读下面这个网页
https://www.ibm.com/developerworks/cn/linux/1609_wenjj_rpm/index.html