Which is the process using apt-get lock? [duplicate]

Try using sudo lsof /var/lib/dpkg/lock to see which process has locked the updater.

You can also use ps -ax | grep dpkg or ps -ax | grep apt however there is also the software centre and auto-updater which could be blocking the process at which point you can kill the offending processes using kill <process id number>.

Have a look here for some more things you can try if these don't work Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?


Enter following line to find the process ID:

lsof /var/lib/dpkg/lock-frontend

Then run this command with the PID that it revealed:

kill -9 PID