yum command output error "db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch".
Environment
- Red Hat Enterprise Linux 8
- Red Hat Satellite 6
- PackageKit
Issue
- yum command output error "db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch".
Resolution
-
Stop packagekit.service
# systemctl stop packagekit.service
-
How to disable packagekit.service.
Refer to: How to disable/enable automatic updates in Red Hat Enterprise Linux 7 or 8?
Root Cause
- A packagekitd is opening the rpm database in a /var/lib/rpm directory.
Diagnostic Steps
yum update fails with following error messages then the command fails.
# yum update
<snip>
(586/586): java-1.8.0-openjdk-headless-1.8.0.332.b09-2.el8_6.x86_64.rpm 32 MB/s | 34 MB 00:01
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
合計 21 MB/s | 1.0 GB 00:47
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
RPM: エラー: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch <==
RPM: エラー: cannot open Packages index using db5 - (-30969) <==
RPM: エラー: /var/lib/rpm にある Package データベースを開けません。 <==
ダウンロード済みのパッケージは、次の正常なトランザクションまでキャッシュに保存されました。
'yum clean packages' を実行することでキャッシュパッケージを削除できます。
エラー: トランザクションを実行できませんでした。
#
Some processes may be opening rpm database file in the /var/lib/rpm directory.
# lsof | grep lib/rpm
packageki 2685 0 mem REG 253,0 1318912 1342180248 /var/lib/rpm/__db.003
packageki 2685 0 mem-R REG 253,0 311296 1342177924 /var/lib/rpm/__db.001
packageki 2685 0 mem REG 253,0 90112 1342180247 /var/lib/rpm/__db.002
packageki 2685 0 40r REG 253,0 168742912 1342177413 /var/lib/rpm/Packages
packageki 2685 0 44uR REG 253,0 311296 1342177924 /var/lib/rpm/__db.001
packageki 2685 0 45uR REG 253,0 311296 1342177924 /var/lib/rpm/__db.001
packageki 2685 0 61u REG 253,0 90112 1342180247 /var/lib/rpm/__db.002
packageki 2685 0 62u REG 253,0 1318912 1342180248 /var/lib/rpm/__db.003
packageki 2685 0 63r REG 253,0 81920 1342177415 /var/lib/rpm/Name
#
PID 2685 is a packagekitd.
# ps auxwwwm grep packageki
root 2685 0.0 6.9 2115332 1100536 ? - Feb25 20:11 /usr/libexec/packagekitd
#
After the packagekit.service is stopped, the yum command is successfully executed.
# systemctl stop packagekit.service
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments