I am really New to UBUNTU 14.04 and whenever I try to update or install anything I get this error:

sudo apt-get update [sudo] password for trojanfm: 
E: Could not ge 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?

marked as duplicate by Radu Rădeanu, Danatela, Avinash Raj, karel, Jorge Castro Apr 22 '14 at 13:37

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.

  • Probably you run 2 instances of program or you have synaptic or some another package manager. – 2707974 Apr 22 '14 at 7:41
  • @Parto Thanks it is solved :D – Yelmaaz Apr 22 '14 at 7:56
  • 3
    Wait for few minutes because apt-get update may have been running in background. This happens when you have just started the ubuntu. Try to run apt-get update, DO NOT DELETE ANYTHING FIRST. – Drt Apr 11 '15 at 6:12
  • I found this question instead of duplicate, and also this one helped me and not the linked duplicate one. – Drt Apr 11 '15 at 6:13
  • I don't think much of any of the answers here. It might be better to find out which process has the lock and kill that process. See this for more info: ubuntuforums.org/showthread.php?t=1858466 – user3728501 Oct 10 '15 at 18:46

search for processes. Since Ubuntu 16.04, "apt" is used instead of "apt-get"

ps -A | grep apt-get

or

ps -aux | grep 'apt-get'

or

ps -A | grep apt

then see if there any process running as apt-get/apt

kill that process it by using:

sudo kill -9 <process-id> 

for example if process id is 2345

sudo kill -9 2345

then run the sudo apt-get update

Edit: If you are sure that you have no instances of dpkg or apt running and you still get the message, you can just delete the file:

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

A lock file is just a file with zero size that indicates locking of a resource.

Update:

As of Ubuntu 16.04 release, apt-get was replaced with apt. The running process can be located with:

ps -A | grep apt
  • I am running no other dpkg program :\ – Yelmaaz Apr 22 '14 at 7:47
  • 2
    ubuntu automatically check for updates once the system boot up, it is not you, it is the system. – kushvarma Apr 22 '14 at 7:49
  • 5
    best way is wait for few minutes while it search for update then run your update command or kill apt-get process, and run manually. once the system boots, it automatically runs sudo apt-get update to search for latest update. :) – kushvarma Apr 22 '14 at 7:51
  • OKAY,THANKS IT WORKED – Yelmaaz Apr 22 '14 at 7:51
  • it should work :) – kushvarma Apr 22 '14 at 7:52

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