📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Command output states ‘dpkg was interrupted, you must manually run sudo dpkg –configure -a’, blocking software updates.

Environment & Reproduction

Ubuntu 20.04 machine after power loss, terminal closure, or forced stop during apt/dpkg transaction.

Root Cause Analysis

Package configuration scripts were not completed, leaving dpkg status entries in half-configured state.

Quick Triage

Check current state with ‘sudo dpkg –audit’ and confirm free disk space in ‘/var’ and root filesystem.

Step-by-Step Diagnosis

Review ‘/var/log/dpkg.log’ for failing package, then inspect postinst script failures and dependency chain.

Illustrative mockup for ubuntu-20-04-lts — ubuntu2004-cp02-dpkg-interrupted.webp
dpkg interrupted transaction analysis on Ubuntu — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Run ‘sudo dpkg –configure -a’, then ‘sudo apt -f install’ and repeat until no broken packages remain.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Illustrative mockup for ubuntu-20-04-lts — ubuntu2004-cp02-dpkg-repair.webp
Repairing interrupted package configuration safely — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Reinstall offending package with ‘sudo apt install –reinstall ‘ or purge/reinstall if script corruption persists.

Verification & Acceptance Criteria

‘sudo dpkg –audit’ returns clean, apt operations succeed, and no packages are left half-installed.

Rollback Plan

Restore from VM snapshot or filesystem backup if core package set becomes unrecoverable.

Prevention & Hardening

Avoid forced reboot during upgrades and use UPS on servers to reduce abrupt transaction interruption.

E: Sub-process /usr/bin/dpkg returned an error code, lock errors, and unmet dependency loops.

Related tutorial: View the step-by-step tutorial for Ubuntu 20.04 LTS.

View all Ubuntu 20.04 LTS tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

man dpkg, man apt-get, and Ubuntu community guides for broken package recovery.

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.