error: db3 error(-) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery

Server Maintenance | Updated 2026

The error db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery indicates corruption in a Berkeley DB (BDB) database file. On cPanel servers this typically affects the RPM database, causing yum and RPM commands to fail.

Quick Fix
mkdir -p /root/rpmdb-backup
cp -a /var/lib/rpm/__db* /root/rpmdb-backup/
rm -f /var/lib/rpm/__db*
rpm --rebuilddb
yum clean all

01. Cause

Berkeley DB files become corrupted when:

  • A yum or RPM transaction was interrupted (server crash, kill -9, disk full)
  • Multiple yum processes ran simultaneously
  • Disk I/O errors occurred during a write
  • The server ran out of disk space mid-transaction

02. Fix: Rebuild RPM Database

  1. Back up the current database files:
    mkdir -p /root/rpmdb-backup
    cp -a /var/lib/rpm/__db* /root/rpmdb-backup/
  2. Remove the corrupted cache files:
    rm -f /var/lib/rpm/__db*
  3. Rebuild the RPM database:
    rpm --rebuilddb
  4. Clean yum cache:
    yum clean all
  5. Test:
    yum check-update
Only Remove __db* Files

Only delete the __db* cache files, NOT the Packages, Name, or other database files in /var/lib/rpm/. The __db* files are lock/cache files that are recreated automatically. Deleting the actual database files would require a full RPM reinstall.

If rebuilddb Fails

If rpm --rebuilddb itself fails, the Packages file may be corrupted. Try:

cd /var/lib/rpm/
/usr/lib/rpm/rpmdb_verify Packages
# If verify fails:
mv Packages Packages.bad
/usr/lib/rpm/rpmdb_dump Packages.bad | /usr/lib/rpm/rpmdb_load Packages
rpm --rebuilddb

Need Server Help?

If RPM database corruption persists, our team can assist with recovery.

Open a Support Ticket

Quick Recap

  1. Back up: cp -a /var/lib/rpm/__db* /root/rpmdb-backup/
  2. Remove: rm -f /var/lib/rpm/__db*
  3. Rebuild: rpm --rebuilddb
  4. Clean: yum clean all
  5. Test: yum check-update

5,200 users found this article useful · Last updated March 2026 · Browse all Server Maintenance articles

  • 53 Users Found This Useful

Was this answer helpful?

Related Articles

Repairing and Optimizing all MySQL and MariaDB Databases on the Server

Server Maintenance | Updated 2026 Regularly repairing and optimizing MySQL/MariaDB tables...

Create CXS Quarantine Directory

Server Maintenance | Updated 2026 ConfigServer eXploit Scanner (CXS) quarantines suspicious...

Error: Multilib Version Problems Found

Server Maintenance | Updated March 2026 "Multilib version problems" is a yum error that...

VPS Time Not Correct with Time Server

Server Maintenance | Updated March 2026 When a VPS or dedicated server's system clock drifts...

Remount /tmp with exec permission

Server Maintenance | Updated 2026 Some software installations and compilation tasks require...



Save 30% on web hosting - Use coupon code Hosting30