Book Image

Troubleshooting CentOS

By : Jonathan Hobson
Book Image

Troubleshooting CentOS

By: Jonathan Hobson

Overview of this book

Table of Contents (17 chapters)
Troubleshooting CentOS
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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. Therefore, in such circumstances, the rudimentary process of restoring the RPM database can be diagnosed by completing the following steps:

# cd /var/lib/rpm
# rm -rf __db*
# rpm -v --rebuilddb

Having completed the above steps, you should be...