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

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

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

Postby deeniel on Wed Nov 28, 2012 10:37 am

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.
deeniel
Level 1
Level 1
 
Posts: 21
Joined: Sat Nov 24, 2012 8:38 am

Linux Mint is funded by ads and donations.
 

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

Postby podagee on Fri Dec 07, 2012 9:06 pm

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
User avatar
podagee
Level 5
Level 5
 
Posts: 801
Joined: Mon Sep 26, 2011 1:45 pm
Location: hawaii

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

Postby accessdennied on Mon Aug 26, 2013 12:11 pm

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:
 man-db


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
accessdennied
Level 1
Level 1
 
Posts: 21
Joined: Wed Jul 17, 2013 8:42 am


Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 8 guests