π ~1 min read
Table of contents
Symptom & Impact
`apt` and `dpkg` commands fail with lock errors, delaying security updates and package installs.
Environment & Reproduction
Usually appears when unattended tasks and manual package commands overlap.
sudo apt update && sudo apt upgrade
Root Cause Analysis
Another process holds `/var/lib/dpkg/lock-frontend` or `/var/lib/apt/lists/lock`, preventing concurrent changes.
Quick Triage
Identify active package processes before removing stale locks.
ps -ef | grep -E 'apt|dpkg|unattended'
Step-by-Step Diagnosis
Check lock owners and confirm process state from logs.
sudo lsof /var/lib/dpkg/lock-frontend /var/lib/apt/lists/lock

Solution – Primary Fix
Wait for active jobs to finish or stop stuck processes, then reconfigure packages.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo kill -9 && sudo dpkg --configure -a && sudo apt -f install

Solution – Alternative Approaches
Temporarily disable unattended upgrades during maintenance windows to avoid lock collisions.
Verification & Acceptance Criteria
`apt update` and `apt upgrade` complete without lock or interrupted transaction errors.
Rollback Plan
If package state worsens, restore from snapshot and re-run package operations in single-user maintenance window.
Prevention & Hardening
Schedule patching jobs with non-overlapping timers and monitor lock contention events.
Related Errors & Cross-Refs
See also interrupted `dpkg` states, half-configured packages, and broken dependency chains.
Related tutorial: View the step-by-step tutorial for Ubuntu 26.04 LTS.
View all Ubuntu 26.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Ubuntu APT and DPKG troubleshooting documentation.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.