1

I have problems with apt-get update once in a while. This error is shown sometimes I try to run this command:

sudo apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
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?

What's going on? I'd like to know the problem and solve it. It's solved once I restart my pc though, but I would like to know what is this error. Thanks.

2
  • It means that another instance of apt is already running and claimed the package index files. Maybe you have another apt-get command running in another terminal? But also the Software Updater process that automatically starts a few minutes after boot or Software Center, Synaptic, ... use apt and can therefore cause this problem. Make sure you don't have any package management processes open in foreground and wait a while until background processes like the automatic updater have finished.
    – Byte Commander
    Aug 18, 2015 at 17:39
  • I'm sry this question was asked before... i checked the other thread and read the answers and I think I'll just reboot whenever i have this problem which rarely happens to me:) Thank for your replies. Aug 18, 2015 at 19:29

1 Answer 1

2

That usually means you have another program that uses apt open. It could be Ubuntu Software Center, the program synaptic, or even another terminal that's running some apt-get ... function.

Try closing all programs that are used to manage software and trying again.

You could find out which program has the lock locked:

sudo lsof /var/lib/apt/lists/lock  
2
  • @waltinator, "lock locked"? Aug 18, 2015 at 18:11
  • "You could find out which program has opened, and is holding open, the file /var/lib/apt/list/lock". A file used to synchronize access to another resource is called a "lock file", which can be "locked" or "unlocked". It's a "lock" only in that all the programs desiring access to the resource have agreed to open and hold the lock file before accessing the resource, and to release the lock (delete the file) when finished. It's a CompSci usage.
    – waltinator
    Aug 18, 2015 at 18:54

Not the answer you're looking for? Browse other questions tagged .