问题:CentOS7更新yum源失败!出现以下报错
[root@VM_166_107_centos conf.d]# yum update
错误:rpmdb: BDB0113 Thread/process 9485/140215745509440 failed: BDB1507 Thread died in Berkeley DB library
错误:db5 错误(-30973) 来自 dbenv->failchk:BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
错误:无法使用 db5 - (-30973) 打开 Packages 索引
错误:无法从 /var/lib/rpm 打开软件包数据库
CRITICAL:yum.main:
Error: rpmdb open failed
解决方案:
1、切换到/var/lib/rpm
目录:
cd /var/lib/rpm
2、使用ls
命令查看目录:
[root@VM_166_107_centos rpm]# ls
Basenames Conflictname __db.001 __db.002 __db.003 Dirnames Group Installtid Name Obsoletename Packages Providename Requirename Sha1header Sigmd5 Triggername
3、删除以__db.
开通的文件:
rm -rf __db*
4、重新编译db
rpm --rebuilddb
4、再次尝试yum update
(显示以下内容说明已经成功):
[root@VM_166_107_centos rpm]# yum update
已加载插件:fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Determining fastest mirrors
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
os | 3.6 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/5): epel/7/x86_64/group_gz | 96 kB 00:00:00
(2/5): extras/7/x86_64/primary_db | 246 kB 00:00:00
(3/5): epel/7/x86_64/updateinfo | 1.1 MB 00:00:00
(4/5): epel/7/x86_64/primary_db | 7.0 MB 00:00:01
(5/5): updates/7/x86_64/primary_db
网友评论