Recovery of Corrupted RPM Databases

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
CRITICAL:yum.main:

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!

  • 6 Users Found This Useful
Was this answer helpful?

Related Articles

How to fix IP Missing issue on cPanel/WHM

We are here to help you with solving the problem of Missing IP Server in list accounts. The...

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...

How to install Attracta SEO Tools plugin

RequirementscPanel/WHM needs to be installed on your server. Step 1: SSH into your server and go...

How to Install CpCleaner in cPanel through SSH?

Installation Run the following shell commands as root via SSH: wget -O cpc-1.0.3.tar...