March 30, 2007 · Package Mgmt · Email This Post

Sponsored Link
If you are getting the following error when you try to install any packages use the following tip to fix this

Error

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?

Solution

First thing you need to check Synaptic Package Manager open at the same time

or

That happens when synaptic or another package update / installation application is already running. Close any other package managers (including Add/Remove application, language pack installer, etc.) and retry.

Sponsored Link

Incoming search terms:

Related posts

54 Comments to “How to fix lock /var/lib/dpkg/lock – open (11 Resource temporarily unavailable) Error”

  1. Robert says:

    Hi I have a very big prob, my iphone was and still is stuck in safe mode because of fake fermware i could not remove, so i went to var,lib apt,list and deleted all except partial, that didnt work so i went to var,lib,dpkg, and deleted the updates and mistakely the files down below update, now my computer will not recognise my iphone plus there is nothing in cydia under manage except the headlines no packages it says no such files as var,lib dpkg, please help.

    [Reply]

  2. Onkar Raut says:

    ps -e | grep apt (might show you a number which is essentially a job number. My system was locked due to apt-get and showed me apt-get as job number 1594)

    sudo kill 1594 (modify number to your current run)

    This works perfect without having to delete the lock and causing unnecessary changes to your system

    [Reply]

  3. jay says:

    kein i dont get it o.o… like what do i uncheck im like new to ubuntu

    [Reply]

  4. kuldeep singh says:

    how can i unlock the var/libs/dpkg/lock file…..plz some buddy short me out

    [Reply]

  5. steve says:

    All processes in linux create lock files that tell another process that it is running or in use. This is so that two programs do no write to a file at the same time and cause each other problems.

    One way to force close the process if you can not do it properly is

    lsof | grep /var/lib/dpkg/lock

    returns something like.
    xx number xx xx xx xx xx xx xx /var/lib/dpkg/lock

    type kill -9 number (this will kill the process id from above)

    —-

    lsof justs lists all open files on your system, and you can use a command like grep to search for the file that is suspect which can be killed if necessary

    [Reply]

  6. Eruaran says:

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

    [Reply]

    Sanket Reply:

    thanks Eruaran it worked for me

    [Reply]

  7. mohsen says:

    thanks a looot
    :-*

    it works great …
    I kill any process which contains apt !!!
    but it works fine :)

    [Reply]

  8. Kok says:

    Thanks Eruaran. That worked for me.

    [Reply]

  9. jack frost says:

    Nothing working for me. I am newb and might be screwing it up. Copied and pasted several of the above options to Konsole and tried them ….nothing removing “lock”. Permissions?

    no problem I am root, what do I do?

    [Reply]

  10. mehul says:

    Hey , Nothing working for me. I am newb and might be screwing it up. Copied and pasted several of the above options to Konsole and tried them…but none of this worked also when i tried from synaptic package manager ..it didnt work !!!,please guide what to do ?

    [Reply]

  11. missnaem says:

    thanks Eruaran
    it works for me ;)

    [Reply]

  12. Rakhunathan says:

    Hey friends,
    just type
    sudo bash (or) sudo -s
    This makes you the root user and obtain administrator previlages. type “whoami” and check that you will be the root user…now all apt commands work..
    …cheers..rakhu…

    [Reply]

  13. Saurabh says:

    Thanks Rakhunathan

    [Reply]

  14. Norah says:

    ps -e | grep apt identified the process number

    Followed by:
    sudo kill #### did not kill the process

    lsof | grep /var/lib/dpkg/lock did not return any results

    However, log off/on did. :)

    [Reply]

  15. suren says:

    from the terminal identify the process number with ps -e | grep apt
    then kill the process with
    kill -9 ####

    [Reply]

  16. Arya says:

    thnx rakhunathan :)

    [Reply]

  17. srikanth says:

    rakhunathan man u helped me save my day.
    thanks

    [Reply]

  18. fr33mat3 says:

    @Rakhunathan,
    It worked great thanks mate :)

    [Reply]

  19. sreetama says:

    I get the following when I run the command, not sure what to do further.

    sreetama@sreetama-laptop:~$ ps -e | grep apt
    4093 ? 00:00:00 aptd
    sreetama@sreetama-laptop:~$ kill -9 4093
    bash: kill: (4093) – Operation not permitted

    [Reply]

    admin Reply:

    try to run this commnd as root using the following command

    sudo kill -9 4093

    enter your password

    [Reply]

  20. lmlng says:

    try this running this line in your terminal:::sudo killall dpkg && killall frontend
    then run:::sudo apt-get update

    [Reply]

Leave a Reply