Running dnf upgrade produces "Thread died in Berkeley DB library"

Problem:

When running system updates using the dnf upgrade (or dnf update) command, you get the following error:

error: rpmdb: BDB0113 Thread/process 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: Error: rpmdb open failed

Solution:

First, you should make a backup of the current RPM database, just in case:

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

Remove the old database:

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

Then, clean and rebuild the RPM database:

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

 

 

 

 

Article Information
  • Article ID: 404
  • Category: AlmaLinux
  • Viewed 186 times.
  • Rating:
    (1)
  • Was this article helpful?
  • Yes No
  • Help us improve this article!
  • Submit Feedback
Did you find this article helpful?