how to recover from a corrupt rpm database

run these commands (as root):

rm -f /var/lib/rpm/__db*
rpm --rebuilddb