The Quick and Dirty Way For Fixing The /var/lib/dpkg/lock Error

When you press Ctrl – C to interrupt a process in the middle of the an apt-get task, you often get this error, and you cannot use apt-get anymore, because the system thinks that another process is using apt-get and it locks it:

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?

The quick and dirty solution for fixing the problem is to delete the /var/lib/dpkg/lock file, like this:

$ sudo rm -rf /var/lib/dpkg/lock

Tagged with: , , , ,
Posted in The Linux and Unix Articles!
2 comments on “The Quick and Dirty Way For Fixing The /var/lib/dpkg/lock Error
  1. Actually I tried that! But it didnt help!

    Instead I tried to grep the dpkg process, and killed the process id with kill -9 ‘pid’.

  2. ignotus says:

    For Ubuntu 13.04:
    sudo dpkg –configure -a

Leave a Reply

Your email address will not be published. Required fields are marked *




Subscribe to get the latest Linux news and how to guides directly on your e-mail!