Linux之yum和rpm命令报错:Error: rpmdb open failed
拿到一台服务器,再部署项目时,用yum安装软件时,报错如下:error: rpmdb: BDB0113 Thread/process 9480/140323413588032 failed: BDB1507 Thread died in Berkeley DB libraryerror: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RU
·
拿到一台服务器,再部署项目时,用yum安装软件时,报错如下:
error: rpmdb: BDB0113 Thread/process 9480/140323413588032 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
error: rpmdb: BDB0113 Thread/process 9480/140323413588032 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 database in /var/lib/rpm
[root@VM-0-5-centos ~]# yum list
error: rpmdb: BDB0113 Thread/process 9480/140323413588032 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
[root@VM-0-5-centos ~]# rpmdb open failed
RPM version 4.11.3
Copyright (C) 1998-2002 - Red Hat, Inc.
This program may be freely redistributed under the terms of the GNU GPL
Usage: rpmdb [-v?] [--initdb] [--rebuilddb] [-D|--define 'MACRO EXPR'] [--undefine=MACRO] [-E|--eval 'EXPR'] [--macros=<FILE:...>] [--noplugins] [--nodigest]
[--nosignature] [--rcfile=<FILE:...>] [-r|--root ROOT] [--dbpath=DIRECTORY] [--querytags] [--showrc] [--quiet] [-v|--verbose] [--version] [-?|--help]
[--usage]
如图:
字面意思rpmdb开启失败,运行rpm -qa,也报错,同样的问题,rpmdb的问题
解决:
1.进到rpm目录
cd /var/lib/rpm
可以看到几个_db开头的几个文件,如图:
2.删除_db开头的文件
rm -rf _db*
3.重新构建
rpm --rebuilddb
好了,执行yum和rpm命令可以了!
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
已为社区贡献1条内容
所有评论(0)