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 14.04 when she encountered this error. Its one of the common occurring update errors in Ubuntu and also one of the least annoying ones.
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.
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