分享 | 交流
让学习成为一种习惯

使用yum时Error: rpmdb open failed解决方法

[root@instance-1 ~]# yum install lrzsz
error: rpmdb: BDB0113 Thread/process 28657/140558929053504 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@instance-1 ~]# yum
error: rpmdb: BDB0113 Thread/process 28657/140558929053504 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出问题了

 

下面解决办法
[root@instance-1 ~]# cd /var/lib/rpm/
[root@instance-1 rpm]# ls
Basenames __db.001 __db.003 Group Name Packages Requirename Sigmd5
Conflictname __db.002 Dirnames Installtid Obsoletename Providename Sha1header Triggername
[root@instance-1 rpm]# rm __db.* -rf
[root@instance-1 rpm]# ls
Basenames Dirnames Installtid Obsoletename Providename Sha1header Triggername
Conflictname Group Name Packages Requirename Sigmd5
[root@instance-1 rpm]# rpm –rebuilddb
至此已经算是成功了,下面清理一下yum缓存即可
[root@instance-1 rpm]# yum clean all
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Cleaning repos: base docker-ce-edge docker-ce-stable elrepo epel extras google-cloud-compute
: google-cloud-sdk nginx updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@instance-1 rpm]# yum update
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
docker-ce-edge | 2.9 kB 00:00:00
docker-ce-stable | 2.9 kB 00:00:00
elrepo | 2.9 kB 00:00:00
epel/x86_64/metalink | 18 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 3.4 kB 00:00:00
google-cloud-compute/signature | 454 B 00:00:00
google-cloud-compute/signature | 1.8 kB 00:00:00 !!!
google-cloud-sdk/signature | 454 B 00:00:00
google-cloud-sdk/signature | 1.4 kB 00:00:00 !!!
nginx | 2.9 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/14): docker-ce-edge/x86_64/primary_db | 16 kB 00:00:00
(2/14): docker-ce-stable/x86_64/primary_db | 13 kB 00:00:00
(3/14): base/7/x86_64/group_gz | 156 kB 00:00:01
(4/14): elrepo/primary_db | 492 kB 00:00:01
(5/14): epel/x86_64/group_gz | 266 kB 00:00:00
(6/14): base/7/x86_64/primary_db | 5.7 MB 00:00:02
(7/14): epel/x86_64/updateinfo | 919 kB 00:00:00
(8/14): epel/x86_64/primary_db | 6.4 MB 00:00:00
(9/14): google-cloud-sdk/primary | 77 kB 00:00:01
(10/14): google-cloud-compute/primary | 3.5 kB 00:00:01
(11/14): google-cloud-compute/updateinfo | 1.1 kB 00:00:01
(12/14): nginx/x86_64/primary_db | 105 kB 00:00:01
(13/14): extras/7/x86_64/primary_db | 185 kB 00:00:01
(14/14): updates/7/x86_64/primary_db | 6.9 MB 00:00:04
Determining fastest mirrors
* base: repos-lax.psychz.net
* elrepo: ftp.yz.yamagata-u.ac.jp
* epel: mirrors.cat.pdx.edu
* extras: mirror.scalabledns.com
* updates: mirror.sjc02.svwh.net
google-cloud-compute 9/9
google-cloud-sdk 509/509
Resolving Dependencies
–> Running transaction check
—> Package google-cloud-sdk.noarch 0:196.0.0-1.el7 will be updated
—> Package google-cloud-sdk.noarch 0:200.0.0-1.el7 will be an update
—> Package nginx.x86_64 1:1.13.11-1.el7_4.ngx will be updated
—> Package nginx.x86_64 1:1.13.12-1.el7_4.ngx will be an update
–> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================
Package Arch Version Repository Size
===================================================================================================
Updating:
google-cloud-sdk noarch 200.0.0-1.el7 google-cloud-sdk 23 M
nginx x86_64 1:1.13.12-1.el7_4.ngx nginx 750 k

Transaction Summary
===================================================================================================
Upgrade 2 Packages

Total download size: 23 M
Is this ok [y/d/N]:

未经允许不得转载:留时刻运维网 » 使用yum时Error: rpmdb open failed解决方法

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

留时刻 - Linux系统教程,运维经验分享

加入我们给我留言