Fix get lock /var/lib/dpkg/lock – Resource temporarily unavailable
You been installing packages or updating your repositories and you run in an error message from apt. “Fix get lock /var/lib/dpkg/lock – Resource temporarily unavailable” this error can become quite annoying to beginners don’t worry I will show you how to remove the lock from /var/lib/dpkg/lock this will remove the lock and allow us to continue installing software and resources from Kali Linux repositories.
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?
First open up a new terminal and use the following command to remove the lock.
If the lock does not remove first time repeat the process above. The screen shot below shows the process of removing the lock as you can see the lock did not remove the first time and I had to repeat the process.
Use dpkg –configure -a to force packages to reconfigure.
sudo dpkg --configure -a
Alternatively you could look up the suspected processes using commands below. By using ps and grep together to create a pipeline we can easily look up suspected packages.
ps -A | grep apt
And then killing all processes that can seen in the output in terminal first you will need to look up the process number. it will by listed by the side of the processes that are running you then need to use the following commands to kill the processes.
sudo kill -6 processnum Or we could alternatively use sudo kill -SIGKILL processnum
get lock /var/lib/dpkg/lock – Resource temporarily unavailable