错误如题:
1 rpmdb: Thread/process 16216/140121371674368 failed: Thread died in Berkeley DB library 2 error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery 3 error: cannot open Packages index using db3 - (-30974) 4 error: cannot open Packages database in /var/lib/rpm 5 CRITICAL:yum.main: 6 7 Error: rpmdb open failed
产生原因:rpm db数据错误导致,需要重建数据库,操作如下:
1 cd /var/lib/rpm 2 # 备份文件,请确认数据库名字 3 find ./ -type f -name "__db.*"|xargs tar zcf db_$(date +%F).tar.gz 4 # 清除旧的数据库 5 find ./ -type f -name "__db.*"|xargs rm -f 6 # 重建数据库 7 rpm --rebuilddb 8 # 刷新缓存9 yum clean all
经过上面的处理之后,就可以正常使用yum相关命令
时间: 2024-11-05 03:45:51