Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?
Some times we get the following error while trying yo install software using apt-get or synaptic packaging manager.
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 we resolve this?
The problem occurs if we are running another applications like synaptic using the directory.
So, if this is the case close the applications and try run the command again.
You will also get this message if you forget to use sudo when executing an apt command.
You can use sudo lsof /var/lib/dpkg/lock to find the process that owns the lock file
Then try to kill the process to remove the lock.
This should be used as last resort. If you use this carelessly you can end up with a broken system.
You can delete the lock file with the following command:
sudo rm /var/lib/apt/lists/lock
You may also need to delete the lock file in the cache directory.
sudo rm /var/cache/apt/archives/lock
After that try using the apt-get or synaptic again.