使用yum时出现Error: rpmdb open failed解决方案


一、问题描述

  使用yum安装软件时出现Error: rpmdb open failed,报错信息显示rpm数据库被损坏。

二、解决方案

  重建rpm数据库。

[root@localhost yum.repos.d]# cd /var/lib/rpm

[root@localhost rpm]# ls
Basenames __db.001 __db.003 Group Name Packages Requirename Sigmd5
Conflictname __db.002 Dirnames Installtid Obsoletename Providename Sha1header Triggername

[root@localhost rpm]# rm __db.* -rf
[root@localhost rpm]# ls
Basenames Dirnames Installtid Obsoletename Providename Sha1header Triggername
Conflictname Group Name Packages Requirename Sigmd5

[root@localhost rpm]# rpm --rebuilddb
[root@localhost rpm]# yum clean all
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
正在清理软件源: local nginx
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

三、结果验证

 

打赏

免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2021 CODEPRJ.COM