今天南京一哥们在安装一个rpm的时候,报了如下错误:
rpmdb: Thread/process 25277/140696976578304 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 – (-30974)
error: cannot open Packages database in /var/lib/rpm
rpmdb: Thread/process 25277/140696976578304 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages database in /var/lib/rpm
由于过多的安装包安装卸载等操作,使得RPM数据库被损坏了,导致rpm以及yum都会报错,具体可以如下方法解决:
rm –rf /var/lib/rpm/__db.*
在做这一步之前可以备份一下db先,但我觉得没啥必要,做完这一步应该可以通过rpm -ivh来安装rpm
rpm –rebuilddb 重建一下
yum clean all
yum list
这样yum应该也ok了