yum提示Error rpmdb open failed错误的解决办法#yyds干货盘点#

​centos系统使用yum命令安装软件包时候报错:

error: rpndb: BDB0113 Thread/process 2229/1 40657048729600 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error (-30973) from dbenv- >fail chk: BDB0087 DB_ RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - ( -30973)
error: cannot open Packages database in /var/1ib/ rpm
CRITICAL :yum. main:
Error: rpmdb open failed

原因是linux必学的60个命令RPM数据库系统使用被破坏,建数据库后恢复正常:​

cd /var/1ib/rpm/
for i in ls| grep ’db.'~ ;do mv $i $i. bak; done
rpm -- rebui lddb
yum clean all