Fedora/RedHat: "rpm" locks up
The the longest time I've always wondered why the hell one of the systems at work would continuously lockup on the RPM command. It was really a pain in the ass as their was a cronjob that would run the following command daily without ever completing, leaving an infinate number of processes open that just sat there:rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpmn' 2>&1
| sort > /var/log/rpmpkgs
The fix, which Google helped me find, is here: http://voidmain.is-a-geek.net/redhat/fedora_1_rpm_lockup_bug_workaround.html
/me brings out the l33t c0py/p4$t3 5k!||z
Let us begin:
$ su -
(enter root's password)
# killall -9 rpm
# rm /var/lib/rpm/__*
That is two underscore "_" characters before the "*" in the above command. You should be prompted if you want to delete the following files:
/var/lib/rpm/__db.001
/var/lib/rpm/__db.002
/var/lib/rpm/__db.003
Answer "y" to each of those files. Now you should be able to again install/remove packages with the "rpm" command. Try and install or remove the same package that caused it to hang up and you will likely find that it now works.
Further Reading:
Specific problem in Bugzilla
Red Hat Bugzilla



