dpkg was interrupted 🐧 Linux

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem

A previous package operation stopped halfway (closed terminal, reboot, power loss), and apt refuses to continue until it’s finished.

Seen on: Linux

Meaning

Run the command it asks for. If that fails, the output will show the specific package to fix (often a failing post-install script).

Common causes

  • Upgrade interrupted (SSH disconnect, Ctrl-C, reboot)
  • Unattended upgrades killed
  • Disk full during an upgrade

⚡ Quick fix

  1. sudo dpkg --configure -a
  2. Then sudo apt -f install and sudo apt upgrade
  3. Use screen/tmux for long upgrades over SSH

Detailed fix by platform

Ubuntu

  1. bash
    sudo dpkg --configure -a
    sudo apt-get -f install
    sudo apt-get upgrade

How to diagnose

  1. Output — Which package fails during --configure -a?
  2. Disk — df -h

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.