common problem in yum
June 15, 2007
I’m at the linux-foundation summit right now and I’ve had a number of fruitful discussions with people who are able to point some specific issues with yum and frequently suggest many and varied ways to fix them. However, something I thought had been documented a bit but I wanted to mention was this:
If you find yum stalls out A LOT right after parsing arguments for various commands and/or that yum search takes a loooooooong time when you know it is not downloading from the network then you probably want to stop all yum and rpm-related processes and run as root:
rpm –rebuilddb
Then go to /var/lib/rpm and make sure __db* files are gone.
Run yum again and see if it makes things faster. I think it will.
Update: It’s been brought to my attention that others have documented this much better than I have:
http://people.redhat.com/berrange/notes/rpmrecovery.html
Go there to get the full story (even if it does say rhel3 at the top)
June 15, 2007 at 10:17 pm
Why is this? Does the rebuild optimize the DB or something?
June 15, 2007 at 10:33 pm
WTF?!? Why should I ever need to do that? These are lockfiles, yes? Why doesn’t yum/rpm/bdb use flock() on those files rather than presence so locks are automatically released if necessary?
June 15, 2007 at 10:59 pm
Rebuilding the indexes seems to be the trick. I’m not sure why it gets out of sync, though.