Wednesday 25 March 2015

How to fix E: Could not get lock /var/lib/apt/lists/lock problem


How to fix E: Could not get lock /var/lib/apt/lists/lock problem

You got following message when you try to run apt-get update command in Ubuntu?

E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
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?

Apply following commands in a terminal to solve this problem,

sudo su
sudo rm /var/lib/apt/lists/lock
apt-get update

OR

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

Remove your /var/lib/dpkg/lock file and force package reconfiguration.

sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a

It should work after this.

No comments: