Red Hat Bugzilla – Bug 6915
rpm needs tools to repair damaged databases
Last modified: 2008-05-01 11:37:52 EDT
As a result of an intaller problem (see bug #6914), we
wound up with a Redhat 6.1 system where the RPM database
thought that a number of RPMs were installed twice (and
when I say 'installed twice', I don't mean with seperate
version numbers; I mean with identical version numbers
It was remarkably hard and tedious to deal with the
- rpm --rebuilddb did nothing to clean up the duplicates
- you cannot 'rpm -e' them; rpm reports that your attempt
to remove them matches more than one thing.
- rpm -Uvh --replacepkgs on such a duplicated RPM does not
stamp out the duplication (although at least it doesn't
make it worse)
- there are no other good tools for dealing with this in
the rpm arsenal that are obvious.
To deal with this, we had to go through the tedious
step of forcefully downgrading each RPM to the 6.0 version
(which purged both entries, since they were from 6.1), and
then upgrading it to the 6.1 version again. All just to
play with the database.
Rpm databases do become damaged from time to time. I think
that rpm badly needs a better set of tools to deal with
this than 'rpm --rebuilddb' (especially when it only deals
with some things, and does nothing about others).
Rpm already has such tools:
1) Removing all occurences of a package (e.g. foo) in the database (no files
rpm -e --allmatches --justdb foo
2) Adding just the header for a package to the database (no files added):
rpm -i --justdb foo*.rpm
In practice, using the tools is often more complicated than reinstalling