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!

Compaq/HP Preasario CQ62
intel celeron 900 2.20ghz
250gb hdd
Mint 13 Cinnamon x64 Dual-Booted With Windows 8 PRO w/ MC x64
User avatar
podagee
Level 5
Level 5
 
Posts: 796
Joined: Mon Sep 26, 2011 1:45 pm
Location: hawaii


Return to Tutorials / Howtos

Who is online

Users browsing this forum: PussyCat and 15 guests