Rick Stevens wrote:
"rm -f /var/lib/rpm/__db.*" deletes the RPM database. You
follow that up with a "rpm --rebuilddb" or RPM will get very confused.
From knowledgeable sources, I've heard that rpm --rebuilddb is
neither required or a even a good idea (anymore), in cases like these.