Dealing with yum hangs on FC6

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.
Posted in linux
23 comments on “Dealing with yum hangs on FC6
  1. John Levon says:

    Good to hear they still haven’t fixed this since RH9!

  2. Troed says:

    Thanks. I got this problem just now for the first time ever (RH9 + Fedora Legacy) and you entry here helped me out.

  3. Bimal says:

    hey this is really a very usefull one.. thanks for all of this. very helpfull to me

  4. vahur says:

    What causes this? Some broken repository?

  5. Erika says:

    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.

  6. 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

  7. Greg says:

    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

  8. Thanks, I was stuck with this on my Senior Seminar project. Couldn’t figure out why yum kept hanging.

  9. Steve says:

    Thanks.. I was banging my head agaist a wall trying to figure out why yum would not update.. This solved it immidately.

  10. Jestem says:

    Little fix, did the trick for me, too~!

  11. Abhijeet Mhatre says:

    Hi Bryan
    Thanks a lot for the post. It helped me too.

  12. 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.

  13. Vins says:

    This solution works very well, however I wonder how the author came up to this solution.

    Thanks for the post though.

  14. Marcus says:

    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!


  15. 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?

  16. Wilson Bilkovich says:

    Thank you for this. I got stuck with Fedora 6 on a client project, and these hangs were killing me.

  17. Richard S. says:

    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!

  18. Senad says:

    Man, you saved me almost reinstalling FC6. Many thanks.

  19. unka says:

    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!

  20. draeath says:

    Well, this just happened to me on FC9.

    Long live yum…

  21. Jason says:

    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)

  22. Simon says:

    Go raibh míle maith agat! Sorted.

  23. Thanks for this, amazing that this is still a problem more then 4 years after your post 😉

3 Pings/Trackbacks for "Dealing with yum hangs on FC6"
  1. […] I finally found this useful post : Dealing with yum hangs on FC6 Basically, you have to remove theses files : rm -f /var/lib/rpm/__db.* ! […]

  2. […] this link for more info - Share and […]

  3. […] this link for more info - Share and […]

Leave a Reply

Your email address will not be published. Required fields are marked *