一叶知秋.

业精于勤,荒于嬉;行成于思,毁于随。

centos7使用yum时报错”Error: rpmdb open failed“

环境:
centos 7.8

问题:

[root@202 ~/nginx-1.17.10]# yum clean all
error: rpmdb: BDB0113 Thread/process 14535/140471288919872 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安装软件卡住后,然后kill -9杀死了进程导致

解决办法:重新初始化rpm的数据库

#cd /var/lib/rpm
#备份
for i in `ls |grep db.`;do mv $i $i.bak;done
#初始化rpm数据库
rpm --rebuilddb
#清理yum缓存
yum clean all
posted @ 2020-08-21 15:17  ccku  阅读(696)  评论(0编辑  收藏  举报