If rpm / yum command hangs during operations or you see error messages -
it means your rpm database corrupted.
/var/lib/rpm/ stores rpm database just delete the same and <strong>rebuild rpm database</strong>:
Command to rebuild rpm database
rm -f /var/lib/rpm/__db*
rpm --rebuilddb -v -v
REFERENCES
http://blog.goodealhosting.cn/2009/12/fix-corrupted-rpm-database-on-centos-5/