yum hangs on installing a specific package

When try to install any packages or update the yum list get hang and nothing happens for this you can try the following this to fix it

root@server01[~]#rm -f /var/lib/rpm/__db.*
root@server01[~]#rpm –rebuilddb