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 rebuild rpm database:
Command to rebuild rpm database
Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?
rm -f /var/lib/rpm/__db*
Read rpm / yum man pages for more information