If for some reason, you kill yum, and it gives you issues running it, you’d try killing it. Normally, you’d try killing the PID by ‘pgrep yum | xargs kill -9’ but that didn’t do it for me. So, I had to find the root of the defunct process.
3048 pts/1 00:00:00 sudo
3049 pts/1 00:00:00 yum
3061 pts/1 00:00:00 ps
As you can see, its defunct, but the pgrep command wouldn’t kill it. So, I had to issue:
ps -ef –forest | grep yum
in order to see the parents of the defunct children. Then I could kill -9 the parents, and get yum freed up. But then I ran into another problem.
$ sudo yum install nc
rpmdb: Thread/process 3012/3077576384 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 – (-30974)
error: cannot open Packages database in /var/lib/rpm
Error: rpmdb open failed
So, now you need to remove the corrupted databases, and rebuild them.
sudo rm /var/lib/rpm/__db.*
sudo yum update
Now yum works again.