RPM command hangs on RHEL, FEDORA, CentOS

on February 16 | in Linux | by | with 6 Comments

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.

Pin It

related posts

6 Responses to RPM command hangs on RHEL, FEDORA, CentOS

  1. A says:

    Thanks, this was useful to me at the right time.

  2. Sasikiran says:

    Thanks, It helped me in solving the issue.

  3. Vinod says:

    Very useful post..!!!

  4. Thiago says:

    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

  5. Victor says:

    thank you very much !

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

    Thanks again !

  6. noriko9556 says:

    Definitely is nice to finally find decent postings like this. I truly liked this.

Leave a Reply

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

« »