Fixing “E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable)” error

Friday, 15th October 2010

You’ve probably encountered the error:

“E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable)” After executing:

debian:~# apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the list directory

There are plenty of reasons which might have led you into this shitty situation, anyways the solution is:

debian:~# killall -9 apt-get aptitude
debian:~# rm -f /var/lib/apt/lists/lock

killall -9 apt-get aptitude might not be really necessary, if there are no hanged apt-get or aptitude processes, however I show it heresince sometimes, it might be the problem cause.

If you further or beforehand get the error:
,br /> E: Could not get lock /var/lib/dpkg/lock – open (11 Resource temporarily unavailable)E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

Then you will have to also delete the /var/lib/dpkg/lock.

debian:~# rm -f /var/lib/dpkg/lock

Hopefully this should be enough for you to solve your apt-get update issues.

Tags:

20 Responses to “Fixing “E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable)” error”

  1. Baptiste says:

    Thanks 🙂
    worked like a charm

  2. Drill says:

    Thanks so much. Magical solution

  3. cengiz says:

    This is really… magical solution… THX

  4. mrdwab says:

    This was the only solution I found that worked. (I had to be sudo though.)

    Thanks!

  5. Tirpox says:

    Thanks very much, I have Ubuntu 10.10 and worked me (the first command didn’t worked me) but when I put the remove, like a magic 🙂
    Thanks again

  6. AlexKaper says:

    tanks.
    it’s work carefully.

  7. CeeJay says:

    Hey, Thanx for the solution. Worked brilliantly

  8. Ur fan says:

    lol….max…..we are badly need of this…..thank u soooooooooo much……….

  9. udana says:

    maxxxxa… THANKS

  10. tanzzel says:

    thanks

  11. raghavendra says:

    thanks ….it works fine

  12. avidms says:

    thanks.. it works

  13. Mehdavi says:

    I have tried the above commonds and I am getting the following messagerm: cannot remove `/var/lib/dpkg/lock’: Permission denied
    why plzzzzzzzzzzzzzz

    • admin says:

      Hi Mehdavi,

      What Linux distribution are you running? Did you tried everything described in the article, are you 100% sure
      /var/lib/dpkg/lock is not existing.

      best
      Georgi

  14. Arnold says:

    Thank you Kiss

  15. cnreema says:

    Yeah! *-* This is the only solution that worked! 🙂

  16. Arik says:

    This is helping me on 12.04…
    Thanks for sharing….

  17. ilPider says:

    many thanks
    useful also on 12.04

Leave a Reply