Troubleshooting

Remove lock-frontend from Ubuntu APT

I logged into my Ubuntu virtual machine and tried to upgrade my system using

sudo apt-get update
sudo apt-get upgrade

I then received an error message which said

E: Could not get lock /var/lib/dpkg/lock-frontend – open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

To find out which processes were using APT, I used the command

ps -A | grep apt

When a list returned with the processes using APT, I then killed those processes using

sudo kill -9 <processID>

At this point I tried upgrading my system, but I received the same error a second time.

So I found the lock-frontend file in the /var/lib/dpkg directory and deleted it using the following command

sudo rm /var/lib/dpkg/lock-frontend

After killing the processes using APT and removing the lock-frontend file, I was then able to upgrade my system and install new packages.

Sources: https://curiousviral.com/unable-to-acquire-dpkg-frontend-lock/

Related Articles