Error: rpmdb Open Failed with cPanel

Server Maintenance | Updated March 2026

The "rpmdb open failed" error means the RPM database is corrupted. This prevents yum from installing, updating, or removing packages, and can block cPanel updates and EasyApache builds. The fix is to rebuild the RPM database.

Quick Fix

Rebuild the RPM database: rpm --rebuilddb. If that fails, remove the stale lock files first: rm -f /var/lib/rpm/__db.* then rpm --rebuilddb.

01. Symptoms

The error typically looks like:

error: rpmdb: BDB0113 Thread/process 12345/140123456789 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'll see this when running yum, rpm, cpanel update, or any operation that queries the package database.

02. Rebuilding the RPM Database

# Step 1: Back up the current database
cp -a /var/lib/rpm /var/lib/rpm.bak.$(date +%Y%m%d)

# Step 2: Remove stale Berkeley DB files
rm -f /var/lib/rpm/__db.*

# Step 3: Rebuild the database
rpm --rebuilddb

# Step 4: Verify yum works
yum check-update

The rebuild process can take 1-5 minutes depending on how many packages are installed. Don't interrupt it.

03. Clearing Stale Locks

If the rebuild fails or yum reports another process is using the database:

# Check for running yum/rpm processes
ps aux | grep -E "yum|rpm" | grep -v grep

# Kill any stuck processes
kill -9 $(pgrep -f "yum|rpm")

# Remove lock files
rm -f /var/lib/rpm/__db.*
rm -f /var/lib/rpm/.dbenv.lock
rm -f /var/lib/rpm/.rpm.lock

# Try rebuild again
rpm --rebuilddb
Important

Make sure no legitimate yum or rpm processes are running before killing processes and removing locks. Running rpm --rebuilddb while another rpm operation is active can make the corruption worse.

04. Prevention

Don't kill yum/rpm processes - Let package operations complete. Interrupting them is the most common cause of RPM database corruption.

Don't run concurrent yum operations - Multiple simultaneous yum commands corrupt the database. Use yum-cron for automatic updates rather than overlapping manual runs.

Monitor disk space - If /var fills up during a yum transaction, the database write can be incomplete.

Schedule regular checks - Add rpm --rebuilddb to a weekly cron as a preventive measure if corruption recurs.

Database Still Corrupted?

If rpm --rebuilddb doesn't fix it or if the corruption keeps recurring, the underlying issue may be disk I/O errors or filesystem corruption. Open a ticket for investigation.

Open a Support Ticket

Quick Recap: Fixing RPM Database Errors

  1. Back up first - cp -a /var/lib/rpm /var/lib/rpm.bak
  2. Remove stale files - rm -f /var/lib/rpm/__db.*
  3. Rebuild - rpm --rebuilddb
  4. Verify - yum check-update
  5. Prevent recurrence - Never interrupt yum/rpm operations

Last updated March 2026 · Browse all Server Maintenance articles

  • 4 Users Found This Useful

Was this answer helpful?

Related Articles

Failed to lock proc mutex: Permission denied

Server Maintenance | Updated 2026 The "failed to lock proc mutex" error in Apache's error log...

PHP Startup: Unable to Load Dynamic Library

Server Maintenance | Updated March 2026 "PHP Startup: Unable to load dynamic library" errors...

FSCK Options and Maintenance

Server Maintenance | Updated 2026 fsck (file system check) scans and repairs Linux...

Create CXS Quarantine Directory

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

cPanel Max Defers Occurring for an Account

Server Maintenance | Updated 2026 When cPanel reports max defers occurring for an account,...



Save 30% on web hosting - Use coupon code Hosting30