Sometimes on CentOS, RHEL, or SUSE platform, you get errors about RPM database. While installing AppDefense using the yum install vmw-glx command, you might notice that the RPM database got corrupted.

Problem

You might get errors like:

error: rpmdb: BDB0113 Thread/process 30493/140433746585344 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 30493/140433746585344 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

Cause

To recover the RPM database, perform the following steps.

Solution

  1. Make a backup of /var/lib/rpm/ files.
    mkdir /var/lib/rpm/backup
    cp -a /var/lib/rpm/__db* /var/lib/rpm/backup/
    
  2. Remove the database files to avoid stale locks.
    /var/lib/rpm/__db
    rm -f /var/lib/rpm/__db.[0-9][0-9]
    rpm --quiet -qa
    
  3. Rebuild the RPM database.
    rpm --rebuilddb
    yum clean all
    

Solution

RPM database is rebuild.