一、问题描述
使用yum安装软件时出现Error: rpmdb open failed,报错信息显示rpm数据库被损坏。
二、解决方案
重建rpm数据库。
[[email protected] yum.repos.d]# cd /var/lib/rpm
[[email protected] rpm]# ls
Basenames __db.001 __db.003 Group Name Packages Requirename Sigmd5
Conflictname __db.002 Dirnames Installtid Obsoletename Providename Sha1header Triggername
[[email protected] rpm]# rm __db.* -rf
[[email protected] rpm]# ls
Basenames Dirnames Installtid Obsoletename Providename Sha1header Triggername
Conflictname Group Name Packages Requirename Sigmd5
[[email protected] rpm]# rpm --rebuilddb
[[email protected] 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
三、结果验证
原文地址:https://www.cnblogs.com/python-wen/p/10868997.html