How to fix E: dpkg was interrupted during unattended-upgrades in APT

APTINTERMEDIATEMEDIUMUpdated Dec 29, 2025· 337 views

This error occurs when a previous package installation was interrupted and left dpkg in an inconsistent state. Running `sudo dpkg --configure -a` recovers the system and allows updates to continue.

Quick fix

Fixes E: dpkg was interrupted during unattended-upgrades

sudo apt-get update
  1. Verify the interrupted state
  2. Run dpkg configuration recovery
  3. Update package lists
  4. Install any missing dependencies
apt — error
sudo apt-get update
E: dpkg was interrupted during unattended-upgrades

What this error means

The dpkg package manager on Debian/Ubuntu systems maintains a lock file and internal state during package installations. When an installation is interrupted (due to power failure, network issues, manual termination, or a conflicting unattended-upgrades process), dpkg cannot proceed with new operations and refuses to install or remove packages until the interrupted state is resolved. The unattended-upgrades system detects this broken state and prevents further updates to avoid data corruption.

Typical symptoms

  • apt-get update or apt-get upgrade commands fail with "dpkg was interrupted" error
  • Package manager refuses to install or remove any packages
  • System shows pending configuration steps that must be completed
  • Updates fail to install even when manually triggered
  • Unattended-upgrades background service cannot proceed with security updates

Common causes

  1. Previous apt or unattended-upgrades process was forcefully killed before completing
  2. System power failure or kernel panic during package installation
  3. Network timeout or connection loss mid-upgrade
  4. Manual interrupt (Ctrl+C) during apt operations
  5. Multiple package managers trying to access dpkg simultaneously
  6. Race condition between user-initiated updates and unattended-upgrades daemon

How to fix "E: dpkg was interrupted during unattended-upgrades"

1Verify the interrupted state

First, check if dpkg is actually in an interrupted state:

bash
sudo apt-get update

This will show you the exact error message and confirm the dpkg lock issue.

2Run dpkg configuration recovery

The primary fix is to run the dpkg configure command with the -a flag (configure all):

bash
sudo dpkg --configure -a

This command unpacks and configures all packages that were left in an incomplete state. You may see prompts asking about configuration file changes—typically pressing Y or accepting defaults is safe.

3Update package lists

After dpkg is repaired, refresh your package lists:

bash
sudo apt-get update

This downloads the latest package metadata from your configured repositories.

4Install any missing dependencies

Fix any remaining package dependency issues:

bash
sudo apt-get install -f

The -f flag stands for "fix" and will install missing dependencies or remove conflicting packages.

5Proceed with upgrades

Now your system is ready for updates:

bash
sudo apt-get upgrade

or for a full distribution upgrade:

bash
sudo apt-get dist-upgrade

Advanced notes

For persistent issues where dpkg --configure -a fails repeatedly, check the dpkg log files: sudo cat /var/log/dpkg.log and sudo ls -la /var/log/unattended-upgrades/. If you see lock files that are stale, you can manually remove them as a last resort:

bash
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend
cd /var/lib/dpkg/updates
sudo rm *
sudo apt-get update

Also check for hung processes: ps aux | grep apt and kill them if necessary with sudo kill -9 <PID> before retrying.

For unattended-upgrades specifically, you can enable automatic dpkg recovery by adding Unattended-Upgrade::AutoFixInterruptedDpkg "true"; to /etc/apt/apt.conf.d/50unattended-upgrades to prevent this issue in the future.

Frequently asked questions

What does "E: dpkg was interrupted during unattended-upgrades" mean?
The dpkg package manager on Debian/Ubuntu systems maintains a lock file and internal state during package installations. When an installation is interrupted (due to power failure, network issues, manual termination, or a conflicting unattended-upgrades process), dpkg cannot proceed with new operations and refuses to install or remove packages until the interrupted state is resolved. The unattended-upgrades system detects this broken state and prevents further updates to avoid data corruption.
How do I fix "E: dpkg was interrupted during unattended-upgrades"?
This error occurs when a previous package installation was interrupted and left dpkg in an inconsistent state. Running sudo dpkg --configure -a recovers the system and allows updates to continue.
What causes "E: dpkg was interrupted during unattended-upgrades"?
Previous apt or unattended-upgrades process was forcefully killed before completing System power failure or kernel panic during package installation Network timeout or connection loss mid-upgrade
Is the "E: dpkg was interrupted during unattended-upgrades" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading