Diagnosing a corrupt RPM database

RPM is a package management tool that stores information about software packages in its own database located at /var/lib/rpm, but on some occasions, it has been observed that this database can fail. If such an event does take place, then this can render the use of the rpm command useless, and in this situation, it is not uncommon to find that the system will begin exhibiting signs of trouble related to any Yum- or RPM-based processes.

For example, during a typical Yum update procedure, you could witness the following message:

"error: cannot open Packages database in /var/lib/rpm"

At this point, I cannot help but stress the importance of a good backup strategy, but as a troubleshooter, this may be out of your control. ...

Get Troubleshooting CentOS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.