📖 ~1 min read
Table of contents
Symptom & Impact
apt and dpkg operations fail with lock errors, blocking updates and package installs.
Environment & Reproduction
Common on Ubuntu 18.04 when unattended upgrades overlap with manual apt activity.
Root Cause Analysis
Another process owns dpkg or apt lock files, or a stale lock remained after interruption.
Quick Triage
Identify active package processes and confirm whether lock files are stale or valid.
Step-by-Step Diagnosis
Inspect lock owners, package state, and recent apt history before cleanup.

Solution – Primary Fix
Stop conflicting jobs, repair interrupted dpkg state, and rerun apt update safely.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
If no process is active, remove stale locks and reconfigure packages before retrying.
Verification & Acceptance Criteria
apt update and apt install complete without lock, dependency, or interrupted-state errors.
Rollback Plan
Restore package lists and snapshots if package consistency worsens after attempted repair.
Prevention & Hardening
Avoid concurrent package tasks and schedule manual maintenance outside unattended-upgrades windows.
Related Errors & Cross-Refs
Could not get lock, dpkg was interrupted, and failed to lock directory messages.
Related tutorial: View the step-by-step tutorial for Ubuntu 18.04 LTS.
View all Ubuntu 18.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Ubuntu apt and dpkg documentation for package locking and recovery procedures.
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.