Admin-Ahead Community

General Category => General Discussion => Topic started by: Aby on January 23, 2014, 02:25:31 pm

Title: How to Recover from Corrupted RPM Database
Post by: Aby 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.

===