8

E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 5200 (apt) N: Be aware that removing the lock file is not a solution and may break your system. E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

1 Answers1

12

Open your terminal and type:

ps -aux | grep -iE "apt"

It will show the id of the process running apt. Kill it with:

sudo kill -9 <process_id>

You could also kill all processes using apt with:

sudo killall apt apt-get

If these commands don't work, you can also remove the files using rm:

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*

NOTE: Be careful with those commands. You could possibly end up with a broken system if you are careless.

Reconfigure the packages, and update:

sudo dpkg --configure -a
sudo apt-get update -y

Best of luck!

Ollie
  • 3,372