HowToSolve: Could not get lock /var/lib/dpkg/lock

Write tutorials here
There are more tutorials here
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
Level 1
Level 1
Posts: 21
Joined: Sat Nov 24, 2012 8:38 am

HowToSolve: Could not get lock /var/lib/dpkg/lock

Post by deeniel »

Hi im a newbie to linux world (also sorry for my poor english)
I installed linuxmint 2 times and both i immidatly got 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?

I guess it happened to everyone at least one time, and couldnt understand what was wrong?
First let say that dpkg is the software at the base of the Debian package management system. dpkg is used to install, remove, and provide information about .deb packages ONCE at the time to avoid any kind errors between theme during these operations.
Everytime we try to do one of these dpkg creates a file in /var/lib/dpkg/ , named lock, to warn that an operation is running on some package and that other packages have to wait.
If we try so, we will get the message above, so a simply solution is to wait for that operation to finish and then we can do the new one.
But it could still happen that even if we dont have any other installation running we still get this error. Why is that?
The answer is that an installation/uninstallation/upgrading was interrupted or other problems came out.
A reboot could make everything turn back to normal but lot of other times wont.
so we could try this simple way, but be carefull and always check before that there arent any other installation/uninstallation/upgrading running:

-first we have to delet the lock file:
sudo rm /var/lib/dpkg/lock
-then we rebuild the dpkg database
sudo dpkg --configure -a
-and at the end we delete any possibile installation that didnt ended
sudo apt-get -f install

I had this problem twice and i never solved it with 1000 solution i found on the net, untill i found this written by Jessica Lambiase on an italian Ubuntu blog, and totally helped me both.
User avatar
Level 5
Level 5
Posts: 760
Joined: Mon Sep 26, 2011 1:45 pm
Location: hawaii

Re: HowToSolve: Could not get lock /var/lib/dpkg/lock

Post by podagee »

all i did was restart my laptop and it stopped.
Say it with me,"podagee,....(poh-duh-gee),"
got it?GOOD!

Toshiba Satellite P755-S5393 Intel i7
octo-core @ 2.20ghz
750gb hdd
8gb ram
Windows 8 PRO w/WMC 64bit
Level 1
Level 1
Posts: 21
Joined: Wed Jul 17, 2013 8:42 am

Re: HowToSolve: Could not get lock /var/lib/dpkg/lock

Post by accessdennied »

i get an error that says

Code: Select all

accessdennied@augmentation ~ $ sudo dpkg --configure -aSetting up man-db (2.6.3-3) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing man-db (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
after running the other step(s) im trying to install something and it wont
also if i could get help one of my usb ports lost connection and when i try to use the search bar in menu cinnamon restarts also theres the prob. bout not being able to install things and uninstall
Post Reply

Return to “Tutorials”