
If you're still getting errors about either the apt cache lock ( /var/cache/apt/archives/lock) or the dpkg lock ( /var/lib/dpkg/lock), you can remove them:Ī package reconfiguration may also be needed after this, as well as fixing any potentially broken packages: due to a power outage), you can remove the apt lock / lock-frontend file and see if that fixes the issue on your Ubuntu / Debian / Linux Mint (and any system that uses APT) system: If nothing else worked (from my experience, this usually happens if the system was forcefully shut down or rebooted while installing or upgrading packages, e.g. Only use this if nothing else worked! Using the commands below may result in broken packages / corruption.


There are cases though in which the solutions mentioned above may not be enough. In some cases, this is enough to fix such "Could not get lock /var/lib/dpkg/lock" and "Could not get lock /var/lib/dpkg/lock-frontend" errors.Īnother potential way to get around this issue is to reboot the system and see if this still occurs. If no processes are using /var/lib/dpkg/lock, the next step is to. If you're using a newer Ubuntu, the message itself will tell you which process is holding the "/var/lib/dpkg/lock" / "/var/lib/dpkg/lock-frontend".
#Sudo apt upgrade unable to acquire dpkg lock install#
Also check if you have other open terminals that are currently running an install / upgrade procedure and wait for those processes to finish. So the first thing to do if you encounter this error is to make sure you close package managers such as Synaptic, etc. Just like the message says, this could happen if another process is using /var/lib/dpkg/lock.
