[Linux] 執行 rpm 指令時,出現 Fatal error, run database recovery?
之前裝好了專案作出來的 rpm 檔,
結果今天想用 rpm 指令去查詢時,卻出現 Fatal error, run database recovery。
而且因為這樣,rpm 指令就一直傳回 package not installed 的訊息:
# rpm -q test_agent error: rpmdb: BDB0113 Thread/process 3326/139805407922240 failed: BDB1507 Thread died in Berkeley DB library error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db5 - (-30973) error: cannot open Packages database in /var/lib/rpm error: rpmdb: BDB0113 Thread/process 3326/139805407922240 failed: BDB1507 Thread died in Berkeley DB library error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages database in /var/lib/rpm package test_agent is not installed
查了一下,應該是 RPM 資料庫損毀了。
執行下面的指令,先把 RPM 資料庫備份一下,
再執行 rpm -rebuilddb
來重建資料庫:
mkdir /tmp/rpm_backup mv /var/lib/rpm/__db* /tmp/rpm_backup/ rpm -rebuilddb
再重新查詢一下 rpm 指令,就可以正常運作囉:
# rpm -q test_agent test_agent-2.0.0-1071.el7.x86_64
參考資料:解決:Yum 執行發生 Error: rpmdb open failed 錯誤
(本頁面已被瀏覽過 178 次)