One of the exciting things about upgrading to Fedora Core 6 is that the yum package manager now frequently hangs on me. This does not fill me with joy.
The most common way in which it falls over is by hanging hard after printing this message:
Parsing package install arguments
What it means to “hang hard” here is that you can’t interrupt it using control-C, or by killing it with a normal, neighbourly signal like SIGINT or SIGTERM. A little bit of digging in another terminal window indicates why:
# pidof yum
30987
This number is yum’s process ID. Let’s see what it’s stuck doing:
# strace -p 30987
Process 30987 attached – interrupt to quit
futex(0xb7bf21a0, FUTEX_WAIT, 2, NULL <unfinished …>
Ooh, look; it’s stuck in a futex system call. This usually means that the culprit is trying to lock a data structure in a memory-mapped file shared with another process. If the other process isn’t around, well, things can get exciting.
By the way, it
is possible to kill yum at this point; you just have to be brutal.
# killall -9 yum
Once the deed is done, a little sniffing around often reveals a few “__db.*” files in /var/lib/rpm. Let’s get rid of these:
# rm -f /var/lib/rpm/__db.*
At this point, retrying the hung yum command should succeed. At least, it does so for me in nine out of ten cases. Occasionally, I need to run “yum clean all” after cleaning up the above mess before yum can make progress.
Good to hear they still haven’t fixed this since RH9!
Thanks. I got this problem just now for the first time ever (RH9 + Fedora Legacy) and you entry here helped me out.
hey this is really a very usefull one.. thanks for all of this. very helpfull to me
What causes this? Some broken repository?
Thanks, this was causing yum and rpm to hang for me. It is always interesting to learn how to use command line tools like strace to figure out what is going on.
This little resolution just resolved all my problems, I could not even do an rpm -qa before removing the db files. Top fix! Many thanks, John
This annoying little bugger is still cropping up on our fc6 machines. Fedora has kinda been dropping the ball on fc6. We have had so many problems with yum-updatesd that we just went back to using cron for scheduled updates. That and yum just keeps getting slower
Thanks, I was stuck with this on my Senior Seminar project. Couldn’t figure out why yum kept hanging.
Thanks.. I was banging my head agaist a wall trying to figure out why yum would not update.. This solved it immidately.
Thanks!
Little fix, did the trick for me, too~!
Hi Bryan
Thanks a lot for the post. It helped me too.
It’s pretty great when you can simply google -” yum hangs” and end up at a post that suggests clearing out the ___db.* files.
I’ve been around the block and would have seen the mutex block, that’s pretty much the reason for almost all hangs (except for infinite recursion loops)…but knowing what to do about it, and having it work.
Wow! It may not be the personal jetpacks or flying cars we were promised by futurists but it sure feels like progress.
Thanks!
This solution works very well, however I wonder how the author came up to this solution.
Thanks for the post though.
Thank you so much – I’ve been having “yum clean packages” commands hanging and clogging up because of cron jobs for a while now.
Your solution has returned my box to it’s previous happy state!
Marcus
I am having a very similar problem with RHEL5 server. Yum will not run. It mentions that it is already running (The graphical software update will not run either).
If I go to System Monitor and find the PID for yum-updatesd, then use kill from the terminal with that PID I can then run yum once. After that, the yum-updatesd is back.
I removed the __db.* as you mentioned, but that does not seem to help me. Horribly frustrating. I have formated and installed this system 5 times. The system seems to work, but I cannot add anything later with yum.
Further thoughts?
Thank you for this. I got stuck with Fedora 6 on a client project, and these hangs were killing me.
My yum was getting stuck right at “Parsing package install arguments,” and the steps listed above fixed it! Thank you — I was working on this for a long time!
Man, you saved me almost reinstalling FC6. Many thanks.
thanks a lot!
first time when i removed those files manualy (shift+del) it didn’t help, it got stuck again, and when when i did it for the second time from console it worked! thanks!
Well, this just happened to me on FC9.
Long live yum…
Well, let me add CentOS 5.2 to the list off affected systems… (not that it’s much of a surprise after Johnathan mentioned RHEL5… I’d suspect Oracle Enterprise Linux 5.x as well)
Jonathan: I’d suggest doing the kill -9, and the __db.### removal, then doing some aggressive ‘yum clean’-ing… you may be running into this problem, and some further cache corruption.
–Jason (wishes that yum would get around to fixing this)
Go raibh mÃle maith agat! Sorted.
Thanks for this, amazing that this is still a problem more then 4 years after your post 😉