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

**Code:** `dpkg was interrupted` · **Category:** Linux · **Seen on:** Linux

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

## 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

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/linux/dpkg-was-interrupted)
