Repair RPM database

当进行包安装、升级、卸载等操作时,可能损坏RPM DB,这时需要通过–rebuild参数来修复RPM DB,但有时会碰到这样的问题:

[root@tiv125 lib]# rpm -v –rebuilddb
rpmdb: fatal region error detected; run recovery
error: db4 error(-30982) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index

这时需要先手动删除 /var/lib/rpm 目录下的 __db.* 文件,比如 __db.001, __db.002, etc.
然后再运行 rpm -v –rebuilddb 即可。

参考:
http://www.rpm.org/hintskinks/repairdb/

This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">