Linux: Fix yum when it hangs, or is it actually RPM?

Post date: May 31, 2012 8:59:47 PM

Originally posted September 10, 2008

I’ve had this happen to me too many times, so I’m blogging it for my own record. my Linux update program, yum, bugs out sometimes and hangs after launching it, doesn’t respond to a CTRL-C, and needs a kill -9 to get rid of!

1) ls -l /var/lib/rpm (look at whats there, backup if paranoid)

2) rm -f /var/lib/rpm/__db*

3) rpm -vv –rebuilddb (takes a while, and -vv is not really needed)

4) yum clean all (if it fails due thinking it’s already open, remove the process id by doing an “rm /var/run/yum.pid” and re-run the “yum clean all” command)

5) yum update

This is basically deleting the old RPM databases, and rebuilding them. See here for the original site I saw this on