Technical Anshu
Tutorials Blog

This is one of the most honest errors in Linux: it tells you what happened and what to run. A package operation has two halves - unpacking files, then configuring them. If the terminal was closed, the PC lost power, or the updater crashed between those halves, some packages sit in the database as unpacked but not configured. dpkg refuses to start anything new on top of that unfinished state, so apt shows E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem for every command. The fix is a short, strict sequence: configure everything pending, repair dependencies, finish the interrupted upgrade, and audit the result. This is an Ubuntu and Debian family problem only - Fedora (dnf) and Arch (pacman) do not use dpkg and never show this error.

Terminal  .  apt
apt refuses everything with one repeated line.
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

X sudo apt install, sudo apt update and Software Updater all fail with this same message

X It started after an install or upgrade window was closed, crashed, or the power went mid-update

X The desktop and your files work normally - only package operations are blocked

DPKG  Packages are half-configured, and dpkg is frozen until they are finished.

The fingerprint of this problem: the exact E: dpkg was interrupted line, word for word, on every apt command.

1

Run Exactly What the Error Says ⭐

This is the main fix, and there is no shortcut around it. The command configures every package that was left unpacked-but-not-configured by the interruption, finishing the original job instead of rolling it back.

  1. Close Ubuntu Software, Software Updater and Synaptic if any of them are open, so nothing else is touching the package database. Plug a laptop into the charger - you do not want a second interruption during the repair.
  2. Open a terminal and run exactly:
sudo dpkg --configure -a
  1. Enter your password when asked and let it finish without closing the terminal. You may see packages being set up one by one, triggers processed, and possibly questions from a package configuration screen - answer them and continue. Depending on how much was interrupted, this takes from a few seconds to several minutes.
  2. If it completes back to the normal prompt with no error block at the end, the freeze is lifted. Continue to Fix 2 anyway - dependency repair and finishing the upgrade are part of the complete cleanup.
  3. If it stops on one named package with an error, note that package name exactly, then still continue to Fix 2 - the dependency repair is designed for precisely that leftover case.
2

Repair Dependencies With --fix-broken

An interrupted upgrade often leaves a package installed without the dependency version it needs. This command makes apt resolve that state - installing missing dependencies or removing what cannot be satisfied.

  1. Run: sudo apt --fix-broken install
  2. Read the plan it prints before pressing Y: it lists what it will install, upgrade or remove to make the package state consistent. On a clean repair this is usually a small list.
  3. Let it finish completely. If it configures the exact package that failed in Fix 1, that is the sequence working as designed.
  4. If apt says there is nothing to do (0 upgraded, 0 newly installed, 0 to remove), your dependency state was already healthy - move on.
3

Finish the Interrupted Upgrade

The original update never completed, so some upgrades are still pending even after the database is repaired. Refresh the package lists and apply the full upgrade so the system reaches the state the interrupted run was heading for.

  1. Refresh the lists: sudo apt update - this should now run without the dpkg error, which is your first proof the freeze is gone.
  2. Apply everything pending: sudo apt full-upgrade - full-upgrade is used instead of a plain upgrade because it is allowed to install or remove dependencies when an upgrade requires it, which interrupted release upgrades often do.
  3. Let it run to a clean finish. If it asks to restart services during configuration, accept the defaults.
  4. Reboot once afterwards if a kernel, driver or core library was part of the completed upgrade.
4

Verify a Clean State With dpkg --audit

Do not declare victory because the error disappeared once. One command audits the entire package database and reports any package still in a half-finished state.

  1. Run: sudo dpkg --audit
  2. No output at all means healthy: no package is half-configured, half-installed or awaiting configuration. This silence is the success result - audit only prints something when there is a problem to describe.
  3. If it does list a package, run the sequence once more in order - sudo dpkg --configure -a, then sudo apt --fix-broken install - targeting that named leftover.
  4. Final confirmation: run sudo apt update followed by sudo apt full-upgrade one last time. A fully repaired system ends with nothing left to do and no errors.
5

Software Needed

Nothing to download and no Live USB is needed - dpkg and apt are the built-in package tools of Ubuntu and Debian, and every command in this guide uses only them. You need a terminal, your sudo password, a stable power connection, and a few uninterrupted minutes. Because Fedora uses dnf and Arch uses pacman instead of dpkg, there is no Fedora or Arch version of this guide: those systems never produce this error and have their own, different interrupted-transaction handling.

If a graphical updater caused it, use the terminal for the repair: Software Updater and Ubuntu Software run the same dpkg underneath, but while the database is in the interrupted state they can only repeat the error. The terminal sequence in Fix 1 to Fix 3 is the recovery path; once dpkg --audit is silent, the graphical tools work normally again.
What NOT to do: do not delete dpkg lock files or the /var/lib/dpkg folder trying to force the error away, do not kill a running dpkg --configure -a because it looks slow, and do not close the terminal mid-configuration - every one of those creates a fresh interruption on top of the old one. The entire repair works because each step is allowed to finish.

More Linux Fixes on Technical Anshu

Every week: Windows and Linux problems, hidden tools and full setup guides, explained step by step.

Subscribe on YouTube

Frequently Asked Questions

Why does every apt command show the same dpkg was interrupted error?

dpkg keeps a record of every package state. When an install or upgrade stops halfway, some packages are left unpacked but not configured, and dpkg marks the database as interrupted. For safety, apt then refuses all installs, removals and upgrades until that half-finished work is configured - otherwise new changes would be layered on top of a broken state.

What exactly does sudo dpkg --configure -a do?

The -a means all: dpkg goes through every package that was unpacked but never configured and runs its configuration step now - creating config files, running its setup scripts and registering it properly. It finishes the interrupted job instead of undoing it, which is why it is the correct first command and why the error message itself names it.

dpkg --configure -a itself stops with an error on one package. What then?

Read the package name and error it prints - it has narrowed the problem to one package. Run sudo apt --fix-broken install next, which resolves missing dependencies around it. If one named package still fails repeatedly, removing just that package with sudo apt remove, then running the sequence again and reinstalling it cleanly, is the standard last resort for that single package.

How do I confirm the package system is fully healthy afterwards?

Run sudo dpkg --audit. No output at all means no package is half-configured or half-installed - the database is clean. Follow it with sudo apt update and sudo apt full-upgrade: a healthy system ends with 0 upgraded, 0 newly installed, 0 to remove and no errors.

Can Fedora or Arch show the dpkg was interrupted error?

No. dpkg is the package tool of the Debian family only - Ubuntu, Debian, Linux Mint and their relatives. Fedora uses dnf and RPM and Arch uses pacman, and neither has dpkg, so this exact error and this exact fix exist only on Ubuntu and Debian family systems.

Guide by Technical Anshu · Problem collected from real user reports on Ask Ubuntu ("E: dpkg was interrupted, you must manually run dpkg --configure"); solution written in original words and verified against Ask Ubuntu guidance and Debian dpkg and apt documentation. No exact-fix or related long video exists yet for this problem on the channel, so this topic is saved as a fresh video topic. No Shorts are linked in this blog.