[ubuntu] Unlock /var/lib/dpkg/lock when you’re locked out
You must have seen this (that’s why you’re here after all!)
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?
This often happens if you try to install a package (say, <package-name>) while you are installing another. As an example, this may happen when you try to run
$ sudo aptitude install <package-name>
in the terminal while you have Synaptic package manager open (or vice versa) or in another terminal you are installing another package . The easiest solution is just to wait for the other installation(s) to finish and close the package manager if you are done with it. However, if the package manager is crashed in the middle some stuck-up processes may still be using the lock (/var/lib/dpkg/lock).
In that case, use fuser to find out the runaway process(es); and while you’re at it, you may use -k flag which will kill the process that is still using /var/lib/dpkg/lock. Then configure (--configure) all the packages (-a) which are yet unpacked and unconfigured, using dpkg:
$ sudo fuser -vki /var/lib/dpkg/lock; sudo dpkg --configure -a
In the first command (fuser), the -i flag asks for user confirmation, and -v is for verbose mode.
After that, proceed to the usual installation step of the package that you want to install.

HEY THANKS A LOT! When I went to this site this is the only one that worked! AWESOME INSTRUCTIONS!
cheers mate worked great!
helped out a lot thx awesome instructions no joke!
Thank you so much !!!!
Great !! It helped a lot..
Thanx a lot.. well explained
thanks so much ive tried at least 50 other sites this is the only one that worked thank you so much
yeah! i stop searching here thanks
thank u!!!!!!!
i love it!! thank you so much
excellent thanks a lot i am new user of ubuntu and it helped so very much but why do we get this error if you can explain that it would be of great help as then in future we would be more aware of not making any fault.
but thanks a ton for this
i dnt knw why mine is still the same.. it said error… dkpg is locked by another process
it’s not working………….
is there another way to do it.
even i can’t open synaptic manager also.
I was not able to do that. I got the following error message:
dpkg: error processing man-db (–configure)
What should I do with that? It will be great if you could help me with that..
It’s not possible to suggest a fix without seeing the complete error message. However, you may want to take a look at the following thread at the Ubuntu forum:
http://ubuntuforums.org/showthread.php?t=1482631
I knew the second part, but I was manually hunting all over the place for lock files. Thank you!
[...] liat link ini deh. Ane lagi males nulis. ini asal nyatet aja, kalo2 lupa.http://nixtricks.wordpress.com/2009/10/02/ubuntu-unlock-varlibdpkglock-when-youre-locked-out/ [...]
[...] from: http://nixtricks.wordpress.com/2009/10/02/ubuntu-unlock-varlibdpkglock-when-youre-locked-out/ Like this:LikeBe the first to like this post. Posted in OS [...]
Thank you very much! That worked =)
/Phil
thanx man…great work