Friday, May 23, 2008

Linux RPMDB

Rebuild rpmdb
---------------

Note: Backup /var/lib/rpm before any activity!

Method # 1

Remove /var/lib/rpm/__db* files to avoid stale locks:
# cd /var/lib
# rm __db*

Rebuild RPM database:
# rpm --rebuilddb
# rpmdb_verify Packages

------------------------------------------------------
Method # 2

If you are still getting errors, then try your luck with following commands:

# mv Packages Packages-BAKUP
# db_dump Packages-BAKUP | db_load Packages
# rpm -qa
# rpm --rebuilddb

No comments: