Today i was trying to update my centOS 5x server (5.3 to be exact) and for some reason when i tried to run a yum update or yum install all i got was a HANGGGGGGGGGGGGGGGGGGGGGGGGGGG.
Luckly i found a rather simple solution (Thank you google!)
Try this. Do all 3 of these steps one after the other:
# rm -f /var/lib/rpm/__db*
# rpm --initdb
# rpm --rebuilddb
I found when doing the above one right after the other that all of my problems went away and yum would once again happily work. It was suggested that this may be related to killing yum or RPM at the wrong time thus leaving a lock file open which can cause you problems.