error: rpmdb: BDB0113 Thread/process 1502/140515876947776 failed: BDB1507 Thread died in Berkeley DB library error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db5 - (-30973) error: cannot open Packages database in /var/lib/rpm CRITICAL:yum.main: Error: rpmdb open failed
这个问题好奇怪啊,之前几天 登入服务器,跟我说 yum 出了问题。
今天登入 服务器,跟我说,yum 可以用了。可能是 最近CPU 漏洞的原因吧,
服务器厂商在打补丁吧,反正现在能用了,以前好好的突然报出这个问题 我也觉得是挺奇怪的。现在能用了就好。
故障描述:今天下午测试OpenStack,在使用yum安装一个包的时候,手欠了下,结果被我终止了,如是有了下面的记录
先清空下缓存,发现rpmdb open failed
[bash]
[root@linux-node1 glance]# yum clean all
error: rpmdb: BDB0113 Thread/process 21357/140557926295360 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 – (-30973)
CRITICAL:yum.main:
Error: rpmdb open failed
[/bash]
然后试了下yum makecache,问题仍旧不能解决
[bash]
[root@linux-node1 glance]# yum makecache
error: rpmdb: BDB0113 Thread/process 21357/140557926295360 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 – (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
[/bash]
解决方法:
[bash]
[root@linux-node1 glance]# ls /var/lib/rpm/
Basenames __db.001 __db.003 Dirnames Installtid Obsoletename Providename .rpm.lock Sigmd5
Conflictname __db.002 .dbenv.lock Group Name Packages Requirename Sha1header Triggername
[root@linux-node1 glance]# rm -f /var/lib/rpm/__db*
You have new mail in /var/spool/mail/root
[root@linux-node1 glance]# rpm –rebuilddb
[root@linux-node1 glance]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base centos-ceph-hammer centos-openstack-mitaka centos-qemu-ev epel extras updates
Cleaning up everything
Cleaning up list of fastest mirrors<span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_end"></span>
[/bash]
问题得到解决 (下面是 另一种 代码风格 展示)
[root@linux-node1 glance]# ls /var/lib/rpm/ Basenames __db.001 __db.003 Dirnames Installtid Obsoletename Providename .rpm.lock Sigmd5 Conflictname __db.002 .dbenv.lock Group Name Packages Requirename Sha1header Triggername [root@linux-node1 glance]# rm -f /var/lib/rpm/__db* You have new mail in /var/spool/mail/root [root@linux-node1 glance]# rpm --rebuilddb [root@linux-node1 glance]# yum clean all Loaded plugins: fastestmirror, langpacks Cleaning repos: base centos-ceph-hammer centos-openstack-mitaka centos-qemu-ev epel extras updates Cleaning up everything Cleaning up list of fastest mirrors
转自:http://blog.51cto.com/molewan/1906370