Monday, January 16, 2017

Ubuntu error Could not get lock /var/lib/dpkg/lock


When you try to run 'sudo apt-get update', sometimes you will get error that says something like this: '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?'.

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?
So how to fix this issue? let's analyze the error message, it is saying that there is other process that's also using root or sudo command, that's why you get this errror. So first thing to do is make sure there is no other process that's running under administrator or sudo command. 

It could be GUI (graphical) app too, so double check that, if you are 100% sure that no other process that's using administrator privilege but still you get the error, then you need to delete the /var/lib/dpkg/lock file, this will solve the issue.
sudo rm /var/lib/dpkg/lock
Another way is to reboot/restart your computer, but probably not a good solution.

No comments:

Post a Comment