2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

yumでDBが壊れた場合はrpm --rebuilddbでDBを再作成する。

Posted at

EC2を何度か再起動した時にネットワークは出られているがyumができないイベントに遭遇したので備忘

発生事象

# yum install
error: rpmdb: BDB0113 Thread/process 1162/281472916105904 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
CRITICAL:yum.main:

こんな感じでCRITICALがでてそれ以降コマンドが動かなくなる

対処方法

組み込みのBerkeley DBの故障が原因なので再作成をする。

# mkdir /var/lib/rpm/backup
# cp -a /var/lib/rpm/__db* /var/lib/rpm/backup/

DB再作成ができなくなると困るので切り戻し用のバックアップを準備

# rm -f /var/lib/rpm/__db.[0-9][0-9]*

壊れているDB情報を削除

# rpm --quiet -qa
# rpm --rebuilddb
# yum clean all

DBを再作成してYumの情報も綺麗にする。

参考URL:
大体これの受け売り
https://hirosetakahito.hatenablog.com/entry/2018/12/25/122316

海外ニキのメモ
https://dba010.com/2021/05/20/rpm-qa-gets-thread-died-in-berkeley-db-library/#:~:text=Reason%3A,the%20RPM%20database%20is%20corrupted.

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?