Rebuilding your RPM database
- November 16th, 2006
- Posted in Linux
- Write comment
It nice to see something are just buried and not forgotten, Like corrupt RPM databases. A few years ago this was a common problem (common to me anyway!). The problem occurs either when two rpm process try and write to the rpm database in /var/lib/rpm or an impatient operator (like me) hits ctrl-c too many times.
When this happens, you rpm process (e.g. the rpm command or yum) would just hang. So why am I talking about this if the problem was fixed ages ago? Well it seem with the new funky yum-updatesd that’s included with FC6 is causing some problems.
You can see if your effected but running this command:
rpm -qa
If you get no output then you’ve screwed your databases. Here’s how to fix it.
- Firstly su or sudo in to root
su - - Clear your rpm caches
rm -v /var/lib/rpm/__* - Now run the rebuild command
rpm -vv --rebuilddb
You now gets some lovely healthy output showing you everything ok. It should look something like this:
D: adding 11 entries to Filemd5s index.
D: read h# 770 Header V3 DSA signature: OK, key ID 4f2a6fd2
D: +++ h# 1084 Header V3 DSA signature: OK, key ID 4f2a6fd2
D: adding "gimp-print-utils" to Name index.
D: adding 2 entries to Basenames index.
D: adding "Applications/Publishing" to Group index.
D: adding 12 entries to Requirename index.
D: adding "gimp-print-utils" to Providename index.
D: adding 2 entries to Dirnames index.
D: adding 12 entries to Requireversion index.
D: adding "4.2.7-22" to Provideversion index.
D: adding 1 entries to Installtid index.
D: adding 1 entries to Sigmd5 index.
D: adding "0beb1e4759ef5a92206941d9f0c9a52e0d546a2c" to Sha1header index.
You should now be able to install or upgrade using yum.
No comments yet.