Sometimes the RPM database get broken and rpm command freezes or doesn't work as expected. Here's what can be done to solve this problem:
rm -f /var/lib/rpm/__* ; rpm -vv --rebuilddb
The extra verbose is for printing some status on screen, the database rebuild process can take a long depending on your machine and package iformation.