Dpkg Was Interrupted You Must Manually Run Sudo Dpkg Configure To Correct The Problem ✯ [CONFIRMED]

The "dpkg was interrupted" error on Linux occurs when package installation is halted, often requiring the command sudo dpkg --configure -a to fix broken installations and reconfigure pending packages. Additional steps, such as sudo apt install -f or removing lock files, may be needed to fully resolve package database locks. Read the full guide on Ask Ubuntu at Ask Ubuntu. E: dpkg was interrupted... run 'sudo dpkg --configure

Part 2: The Standard Fix (Works 95% of the Time)

The error message itself is unusually helpful. It literally tells you what command to run: The "dpkg was interrupted" error on Linux occurs

sudo dpkg --configure -a

Here is what that command does:

7. Prevention Best Practices

  1. Do not force-kill dpkg – Allow it to finish, even if slow.
  2. Avoid power loss during updates – Use a UPS or laptop battery.
  3. Run updates in a tmux or screen session – Resists terminal closure.
  4. Use apt instead of direct dpkg – APT adds safety checks.
  5. Monitor disk space – A full /var can cause silent failures.

4. If locks are present (concurrent process)

  1. Identify process holding lock:
ps aux | grep -E 'apt|dpkg|apt-get|unattended-upgrade' | grep -v grep
  1. If a valid process is running (e.g., unattended-upgrades), wait for it to finish. If stuck or zombie, stop it gracefully:
sudo kill <PID>
sudo kill -9 <PID>   # only if gentle kill fails
  1. If no process exists but lock files remain, remove stale locks:
sudo rm /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock /var/cache/apt/archives/lock

Then rerun:

sudo dpkg --configure -a