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.
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
- Back up the current database files:
mkdir -p /root/rpmdb-backup cp -a /var/lib/rpm/__db* /root/rpmdb-backup/ - Remove the corrupted cache files:
rm -f /var/lib/rpm/__db* - Rebuild the RPM database:
rpm --rebuilddb - Clean yum cache:
yum clean all - Test:
yum check-update
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 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 TicketQuick Recap
- Back up:
cp -a /var/lib/rpm/__db* /root/rpmdb-backup/ - Remove:
rm -f /var/lib/rpm/__db* - Rebuild:
rpm --rebuilddb - Clean:
yum clean all - Test:
yum check-update
5,200 users found this article useful · Last updated March 2026 · Browse all Server Maintenance articles
