RPM command hangs on RHEL, FEDORA, CentOS

Today i face an issue, which is quite old and i experienced a lot with it and i usually doing reboot to fix it but you cannot reboot your production server. The issue founds on RHEL, Fedora and CentOS system that whenever you run any rpm command i.e trying to install any software or query rpm database, it just stuck after enter and wont do anything.

After diagnosing it, I found up2date is running on my server, so first thing just clear that if something related to rpm is running including yum or up2date, it will lock some files to do any other rpm transaction.

I use kill command to kill the process of up2date but still the problem was same, rpm got stuck / hang and wont do anything further.

Then i issued lsof command to find which files were locked and in used by any old or dead process related to rpm

lsof | grep /var/lib/rpm/

I found /var/lib/rpm/__db* are locked by some process maybe up2date, so i need to delete them to release rpm database for further transaction.

rm -rf /var/lib/rpm/__db*

and it works, all the installation/query of rpm working absolutely fine. I hope this will help.

Related Posts

6 thoughts on “RPM command hangs on RHEL, FEDORA, CentOS

  1. I know this is a very old post, but I need to thank you for your help.
    Had 2 servers with this issue and I couldn’t find a solution. The only difference is that the files didn’t get locked, but removing them and forcing them to be recreated solved the problem.

    Thank you

  2. thank you very much !

    It helped me a lot, when I was a doing an update of some rpm, in prodcution system !

    Thanks again !

Leave a Reply

Your email address will not be published. Required fields are marked *