安装软件包的时候,被手动终止可能会导致rpm数据库被损坏
报错信息:
[root@dhcp yum.repos.d]# yum clean all
rpmdb: Thread/process 4541/140619363587840 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/rpmCRITICAL:yum.main
:Error: rpmdb open failed[root@dhcp yum.repos.d]# yum makecache
rpmdb: Thread/process 4541/140619363587840 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal
error, run database recoveryerror: cannot open Packages index using db3 - (-30974)error: cannot open Packages database in /var/lib/rpmCRITICAL:yum.main:
按照下面的方法进行重建
cd /var/lib/rpm/rm __db.* -rfrpm --rebuilddbyum clean all