[Solved] The solution to /var/lib/dpkg/lock-frontend when Ubuntu executes apt-get update

sudo apt-get update

Sometimes the following error will be reported when Ubuntu executes the above statement

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?

Reason: It is because some other program is trying to update Ubuntu. When a command or application updates the system or installs new software, it locks the dpkg file (Debian package manager).

Simple and crude solution:

Execute all the following statements, and then you can execute the apt-get update statement

sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock
sudo rm /var/cache/apt/archives/lock

The article knowledge points match the official knowledge files, and you can further learn related knowledge CS introductory skill tree Linux entry First acquaintance with Linux15993 people are learning the system