Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to Recover from Corrupted RPM Database  (Read 2907 times)

0 Members and 1 Guest are viewing this topic.

Aby

  • Guest
How to Recover from Corrupted RPM Database
« on: January 23, 2014, 02:25:31 pm »

When installing rpm packages or using up2date to update packages  on Oracle / RedHat Enterprise Linux, you may get the following error,

$ sudo up2date --nox --register
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30978) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30978)
error: cannot open Packages database in /var/lib/rpm
An error has occurred:
exceptions.TypeError
See /var/log/up2date for more information

This error is caused by a corrupted RPM database, run the following commands to recover the database.
# cd /var/lib/rpm
# rm -f __db.*
# rpm --rebuilddb

The "--rebuilddb" rebuilds the database indices from the installed RPM package headers.

===