The dpkg frontend lock prevents two package managers from changing the package database at once. The safe fix is to identify the owner and let a legitimate update finish. Deleting lock files does not stop the process that owns them and can allow concurrent writes.
Read the process ID in the error
APT usually prints the PID and process name. Inspect that PID without changing it:
ps -fp PID
sudo lsof /var/lib/dpkg/lock-frontendReplace PID with the number from the error. A Software Updater window, another terminal or an automatic update may be active.
Check Ubuntu’s automatic update jobs
systemctl status apt-daily.service apt-daily-upgrade.service
systemctl list-timers 'apt-daily*'
journalctl -u apt-daily.service -u apt-daily-upgrade.service -bIf a normal job is progressing, wait for it to complete. Do not reboot or kill it merely because it has held the lock for a few minutes.
If the owner is truly stuck
Confirm that the PID is unchanged and no package operation is making progress. Close a graphical package manager normally. For a process you started and have determined is hung, request a normal termination first:
sudo kill -TERM PIDAllow it time to exit. Avoid kill -9 unless graceful termination is impossible and you understand the recovery work it may create.
Repair interrupted configuration
After the original process has exited and no process owns the locks, run:
sudo dpkg --configure -a
sudo apt --fix-broken install
sudo apt updateReview any proposed removals before confirming. If dependency repair reports conflicts, continue with the held broken packages guide.
Do not delete the lock file
The lock is coordination state, not the root cause. Removing /var/lib/dpkg/lock-frontend, /var/lib/dpkg/lock or APT list locks while a process is running can expose the database to simultaneous modification.
Sources and verification
Diagnostic and repair steps checked against Ubuntu package-management guidance on September 11, 2026. No active production package process was terminated.
