Recovery of Corrupted RPM Databases Print

  • 0

RPMs are the core of Linux systems. When you install software on the server, the software name and its information are stored in the RPM database. So you can do later if you need to reinstall or update. Sometimes the database crashes causing yum and rpm to stop working. For example, if the above problem occurs, the output of yum or rpm -qa will look like this:

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

You will see the following message in thirty panels:

ERROR: The system cannot update the /var/cpanel/sysinfo.config file because it cannot determine your distribution's major version. 
Run the following command: rpm -qf --queryformat '%{VERSION}\n' /etc/redhat-release Output other than the numbers 6 or 7 indicates a problem.
Open a support ticket or resolve the issue manually.

To fix the above problem, the first copy from the previous database and packages list:

mkdir /backups/
tar -zcvf /backups/rpmdb-$(date +"%d%m%Y").tar.gz  /var/lib/rpm

Then delete the previous database:

rm -f /var/lib/rpm/__db*

Then rebuild the database:

rpm -vv --rebuilddb

Successful and victorious!

Was this answer helpful?

« Back

Send Message