如使用yum安裝軟件包的時候,不正常關閉程序或手動關閉程序都有可能令rpm的資料庫損壞,資料庫損壞時所顯示的錯誤訊息。
[root@servername ~]# yum
rpmdb: Thread/process 11267/140010620045216 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
CRITICAL:yum.main:
Error: rpmdb open failed
[root@servername ~]# yum clean all
rpmdb: Thread/process 11267/140010620045216 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
CRITICAL:yum.main:
Error: rpmdb open failedrpm資料庫損壞的時候,可以按照如下的方法重建資料庫。
[root@servername ~]# cd /var/lib/rpm/
[root@servername ~]# mv __db* /tmp/
[root@servername rpm]# rm __db.* -rf
[root@servername rpm]# rpm –rebuilddb
[root@servername rpm]# yum clean all
重建資料庫完成後,再次使用yum指令便可執行成功。
[root@servername rpm]# yum update
Loaded plugins: product-id, rhnplugin, search-disabled-repos, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Update Process