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? How can I fix this?
|
|
WARNING: This answer is applicable to Ubuntu version < 11.04, do not use it in a newer version as it will hard freeze your system As per the other answers there is a package management app holding the lock. When unsure do not manually remove the lock, first run:
This will kill any processes opening the file before removing it. |
|||||||||||||||||||||
|
|
You will get this message if you forget to use Otherwise this is a sign that something else is installing or removing software and has locked the apt database while it performs the actions. The programs that can do this are:
You can force the lock off by removing the file, but it's not recommended without first closing the program that's holding the lock safely, since you could cause corruption or interrupt an installation (bad). The command provided by João should close the program that holds the lock and then remove the lock but won't protect you from install interruption:
And the same command can be used for the apt cache lock:
|
||||
|
|
|
You can delete the lock file with
you may also need to delete the lock file in the cache directory
after that try open synaptic again |
|||||||||||
|
|
Remove your
It should work after this. |
|||||
|
|
Only one program can hold the lock. Make sure that you are not running aptitude, synaptic or adept. Close the program and run it again it should work.You may either have synaptic open, or have another terminal window open running apt-get, or have the update manager running.Check it and see if any of those are running,if any of them is running close it and try again. Try this command in terminal to find what is running Note: |
|||||||||
|
|
Just apt-fast MAY be responsible for not unlocking properly; this happens sometimes when you abort |
|||
|
|
|
My guess is that the most likely way to hit this is:
and the command-line apt overlaps with update-manager automatically polling. So if you try again in a few minutes that should fix it. |
|||
|
|
|
This will happen if you have 'Update Manager' running in parallel for any update check or install as install process places Lock. If you're facing the same error without 'Update Manager' running you have to remove it from
works fine. Taken from: http://askubuntu.com/a/15469/68707 |
||||
|
|
|
Do not type the command!!!!
The process "fuser" will access the communication with the graphics card, and possibly eliminate it. If you plan to execute this command first type (ctrl+alt+F2) and execute it in a different tty session, so your graphics is not changed while it is used by your Xorg session. I would try the classic
or just...
If I was to do this while staying in Xorg(or the GUI) |
|||
|
|
|
After running commands told by Kern in his answer, you may try this:
Now run:
|
||||
|
|
|
If you have an aborted upgrade you get a lock too, for removing that lock execute following commands
I sometimes minimize my synaptic and forget it's open and get the error when working in terminal just close all programs synaptic. upgrade manager, and software center |
|||||
|
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.