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.
» Linux » RPM command hangs on RHEL, FEDORA,...