Fix E: Could not get lock /var/cache/apt/archives/lock [Quick Tip]

Care to Share?

Problem:

The other day a reader asked me that she had troubles with this kind of error:

E: Could not get lock /var/cache/apt/archives/lock – open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/cache/apt/archives/

She was trying to follow one of the tips mentioned in things to do to after installing Ubuntu 13.10 when she encountered this error. Its one of the common occurring update errors in Ubuntu and also one of the least annoying ones.

Reason:

If you are wondering what caused this error in the first place, the reason is quite evident in the error itself. The error says: Could not get lock /var/cache/apt/archives/lock – open (11: Resource temporarily unavailable). And this is what precisely happening. While you are trying to install some package with APT, some other package manager is running or an update is going on.

Solution:

The first and foremost thing is to do nothing. I mean it. Once the other program that is using the resource completes the process, the resources will be available again.

If you are not able to figure which other program is causing this issue and want to get the control back immediately, try the following command to fix the issue of E: Could not get lock /var/cache/apt/archives/lock – open (11: Resource temporarily unavailable):

sudo rm /var/lib/apt/lists/lock

If the above command doesn’t work, try the one below:

sudo killall apt-get

This should kill (read close) all the other APT process running. I hope this quick tip helps in solving this common update error in Ubuntu. Any questions or suggestions are welcomed. Ciao :)

  • Sudeepto Dutta

    Thanks man. This problem is quite frequent with me too. But after knowing the reason and solutions to counter it, now I can deal with it :)

  • Tommy

    Hi
    It doesnt work for me.

    Still have on install that I cant kill.

    br
    Tommy

    • Tommy

      Was the picture lost?
      Here it is again.