使用yum时用Ctrl+C强制终止出现的Error: rpmdb open failed解决方案
刚才为了写有关yum的博客,我在我的CentOS7操作系统使用yum -h想把里边的信息复制出来整理一下大家讲一下yum的具体操作,由于我不小心把yum -h里边的内容给复制到shell命令行了,这下子倒霉了,不断的有yum …… 的命令出现,于是我不断使用ctrl+C快捷键进行命令终止操作,当所有操作都终止了,以下问题出现了:
[root@fnw ~]# yum clean all
error: rpmdb: BDB0113 Thread/process 58171/139859184105280 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@fnw ~]# yum grouplist
error: rpmdb: BDB0113 Thread/process 58171/139859184105280 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@fnw ~]# yum --help
error: rpmdb: BDB0113 Thread/process 58171/139859184105280 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的操作都有一个同样的问题那就是:
error: rpmdb: BDB0113 Thread/process 58171/139859184105280 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
2、根据提示我们可以知道rpm数据库在yum安装过程中使用Ctrl+C给损坏了,需要我们重新构建,下面是重新构建的方法及步骤:
[root@fnw Packages]# cd /var/lib/rpm
[root@fnw rpm]# ls
Basenames __db.001 __db.003 Group Name Packages Requirename Sigmd5
Conflictname __db.002 Dirnames Installtid Obsoletename Providename Sha1header Triggername
[root@fnw rpm]# rm __db.* -rf #删除rpm库
[root@fnw rpm]# rpm --rebuilddb #rpm的重新构建命令
[root@fnw rpm]# yum clean all #用yum clean all重新测试
Loaded plugins: fastestmirror, langpacks
Cleaning repos: c7-media
Cleaning up everything
Cleaning up list of fastest mirrors
[root@fnw rpm]# yum grouplist #用yum grouplist 命令重新测试
Loaded plugins: fastestmirror, langpacks
c7-media | 3.6 kB 00:00:00
(1/2): c7-media/group_gz | 155 kB 00:00:00
(2/2): c7-media/primary_db | 2.8 MB 00:00:00
Determining fastest mirrors
Installed Environment Groups:
Server with GUI
Available Environment Groups:
Minimal Install
Compute Node
Infrastructure Server
File and Print Server
Basic Web Server
Virtualization Host
GNOME Desktop
KDE Plasma Workspaces
Development and Creative Workstation
Installed Groups:
Compatibility Libraries
Development Tools
Available Groups:
Console Internet Tools
Graphical Administration Tools
Legacy UNIX Compatibility
Scientific Support
Security Tools
Smart Card Support
System Administration Tools
System Management
Done
OK,成功了,问题解决了。
本文出自 “放牛娃” 博客,请务必保留此出处http://fangniuwa.blog.51cto.com/10209030/1750680