Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

when I try to apt-get update I'm getting the below error,

E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
share|improve this question
1  
@Mitch With the note that it is about /var/lib/apt/lists/lock rather than /var/lib/dpkg/lock. –  gertvdijk Aug 22 '13 at 12:47
1  
@gertvdijk The OP's question is about /var/lib/apt/lists/lock, and the answer I refrenced also is about /var/lib/apt/lists/lockas well, especially the 4th and 11th answers. –  Mitch Aug 22 '13 at 12:54
add comment

marked as duplicate by raaz, Radu Rădeanu, Stephen Myall, Eric Carvalho, guntbert Aug 24 '13 at 11:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

This just means that there is an application using apt.

First try to find out which application it is by using this command in the terminal

ps aux | grep apt | grep -v 'grep'

If there is a process running using apt (like apt-get or aptitude), the best thing to do is just to let it finish what its doing. Otherwise you can kill it using kill <PID of the process (2nd column in output of ps aux)>.

After making sure there is no process or killing it, you can just remove the lock using sudo rm /var/lib/apt/lists/lock

share|improve this answer
2  
drop the second pipe by adding some square brackets ps aux | grep [a]pt –  shtuff.it Mar 28 at 14:24
    
The trick by @shtuff.it requires quotes for me ps aux |grep "[t]mux" . It works by changing the ps COMMAND listing for grep into grep [t]mux, which does not match the regex [t]mux . Clever. –  here Apr 17 at 18:03
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.