» Red Hat/Fedora "rpm" lockup bug and how to fix it
I don't know if you have run into this but I have a few times now. There appears to be a bug in the Red Hat 8.0, 9, and Fedora "rpm" utility. Sometimes during the installation or removal of an RPM the "rpm" program will just hang up. The only thing you can do is kill the process, but doing so will not fix the problem. The "rpm" database just appears to be locked at this point and will not allow you to perform any other "rpm" command from this point on.
Not to worry, I found a similar case in bugzilla which lead me to a solution (workaround). The workaround will not permanently solve the problem as you will have to perform this each time "rpm" gets into this hung state. Fortunately it doesn't seem to happen often. Here's what you do when your "rpm" command is hung up:
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:
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.
Specific problem in Bugzilla
Red Hat Bugzilla