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?
Asked
Active
Viewed 4.1k times
5
-
If you're like me, I'd check for another window on another workspace where you started a upgrade/install etc, and it got to a point where it's asking for permission to continue etc.. Answer & finish that and it resolves itself (it can also be you were just unlucky and the system happened to be checking for upgrades, meaning after a few mins that will have been resolved by itself anyway). – guiverc Jun 13 '20 at 00:43
-
I figured it out all you have to do is mount os folder on desktop – David Paul Browning Jun 14 '20 at 11:35
1 Answers
9
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
- 2,932
-
Thanks , but all i did was mount the folder on desktop.. Fixed – David Paul Browning Jun 14 '20 at 11:37
-