How to fix unattended-upgrades: dpkg was interrupted, you must manually run 'dpkg --configure -a' in APT

APTINTERMEDIATEHIGHUpdated Oct 26, 2026ยท 191 views

The "dpkg was interrupted" error occurs when unattended-upgrades detects that a previous package installation was not completed, leaving the system in an inconsistent state. This can happen after unexpected reboots, power failures, or system crashes during package operations. The fix involves running 'dpkg --configure -a' to complete any pending package configurations and restore system consistency.

Quick fix

Fixes unattended-upgrades: dpkg was interrupted, you must manually run 'dpkg --configure -a'

sudo dpkg --configure -a --dry-run
  1. Check the current dpkg status
  2. Complete pending package configurations
  3. Update package lists and check for issues
  4. Clean up any lock files if necessary
apt โ€” error
sudo dpkg --configure -a --dry-run
unattended-upgrades: dpkg was interrupted, you must manually run 'dpkg --configure -a'

What this error means

This error indicates that unattended-upgrades has detected an incomplete package operation from a previous system state. The dpkg package manager maintains a database of package states, and when an installation, upgrade, or removal is interrupted before completion, dpkg is left in a state where some packages are unpacked but not fully configured. When unattended-upgrades runs and detects this condition, it stops and notifies you that the system cannot proceed with new upgrades until the interrupted operation is resolved. The 'dpkg --configure -a' command is the standard way to complete any pending package configurations and bring the system back to a consistent state. This error typically appears after: - Unexpected system reboot during package updates - Power failure or system shutdown during apt operations - Manual interruption of apt/dpkg processes - Disk space issues that caused operations to fail partway through

Typical symptoms

  • Unattended-upgrades service stops and logs the dpkg interrupted error
  • System cannot perform any apt operations (apt update, apt install, apt upgrade all fail)
  • Error message explicitly states dpkg is in an inconsistent state
  • System may have rebooted or crashed unexpectedly before the error appeared
  • Package installation or upgrade logs show incomplete operations
  • dpkg lock files may exist from a previous interrupted operation

Common causes

  1. Unexpected system reboot during unattended-upgrades package operations, leaving packages in a partially-installed state
  2. Power failure or unexpected shutdown while apt was installing or configuring packages
  3. Manual interruption (Ctrl+C) of apt or dpkg commands during package operations
  4. Disk space exhaustion causing an apt operation to fail partway through
  5. System crash or kernel panic during package management operations
  6. Previous unattended-upgrades run was forcibly terminated before completion

How to fix "unattended-upgrades: dpkg was interrupted, you must manually run 'dpkg --configure -a'"

1Check the current dpkg status

First, verify that dpkg is indeed in an interrupted state by running:

bash
sudo dpkg --configure -a --dry-run

The --dry-run flag shows what would be configured without actually making changes. This lets you see which packages are waiting to be configured without taking action yet.

2Complete pending package configurations

Once you've confirmed the pending configurations, run the command to actually complete them:

bash
sudo dpkg --configure -a

This command goes through all packages that have been unpacked but not yet fully configured and completes their installation. This typically takes a few minutes depending on how many packages are waiting.

3Update package lists and check for issues

After dpkg completes, update your package lists and check for any remaining issues:

bash
sudo apt update
sudo apt --fix-broken install

The --fix-broken install command will install any missing dependencies or fix any remaining broken package states. This ensures your system is fully consistent before resuming automatic updates.

4Clean up any lock files if necessary

In rare cases where dpkg lock files are stuck, you may need to remove them. Only do this if dpkg is completely hung and unresponsive:

bash
sudo rm -f /var/lib/dpkg/lock
sudo rm -f /var/lib/dpkg/lock-frontend
sudo rm -f /var/cache/apt/archives/lock

After removing lock files, run dpkg again:

bash
sudo dpkg --configure -a

Lock file removal should only be a last resort when the system is truly deadlocked.

5Verify system consistency with apt check

After resolving the dpkg state, verify that your package system is consistent:

bash
sudo apt-get check

This command checks for broken package dependencies without making any changes. If it completes without errors, your system is ready for normal operations.

6Enable automatic dpkg repair in unattended-upgrades configuration

To prevent this error from appearing in the future, configure unattended-upgrades to automatically repair interrupted dpkg state. Edit the configuration file:

bash
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

Find or add the following line (it may already be there):

bash
Unattended-Upgrade::AutoFixInterruptedDpkg "true";

If it's set to false or missing, change it to true. This setting makes unattended-upgrades automatically run dpkg --configure -a if it detects an interrupted state, preventing manual intervention from being required:

bash
sudo systemctl restart unattended-upgrades

Restart the service to apply the configuration change.

7Check system logs for the cause of interruption

Review system logs to understand what caused the dpkg interruption originally:

bash
sudo journalctl -xe | tail -50
sudo tail -100 /var/log/unattended-upgrades/unattended-upgrades.log

Look for:
- Unexpected reboot messages
- Power failure indicators
- Disk space warnings (No space left on device)
- Kernel panic messages

Understanding the root cause helps prevent future interruptions. For example, if disk space was the issue, you may need to clean up or expand your filesystem.

Advanced notes

AutoFixInterruptedDpkg Setting: Unattended-upgrades includes the AutoFixInterruptedDpkg setting which defaults to true on many systems. When enabled, this setting automatically runs dpkg --configure -a if the daemon detects an incomplete dpkg state before attempting any new package operations. This makes the manual error essentially transparent to the user.

Understanding dpkg States: The dpkg package manager tracks states for each package: unpacked (files extracted but not configured), configured (fully installed and ready), removed (deleted but config files remain), and purged (completely removed). When an operation is interrupted mid-process, packages can be left in the unpacked or half-configured state. Running dpkg --configure -a completes the move to the configured state.

Prevention Through Stability: Common causes of interruption include:
- Power issues: Use UPS (Uninterruptible Power Supply) for servers
- Disk space: Monitor available space and set up alerts
- Network: Ensure stable network for remote upgrades
- Reboot timing: Configure unattended-upgrades to reboot during maintenance windows when users are less likely to interrupt

Force-Confold vs Interactive: When multiple versions of a configuration file exist, dpkg can prompt for manual resolution. In automated environments, the --force-confold flag keeps the old configuration file automatically. Unattended-upgrades handles this through its own configuration settings.

Checking dpkg.log: For forensic analysis of what failed:

bash
sudo tail -100 /var/log/dpkg.log | grep 'status'

This shows the state changes dpkg recorded, helping identify at what point the interruption occurred.

Frequently asked questions

What does "unattended-upgrades: dpkg was interrupted, you must manually run 'dpkg" mean?
This error indicates that unattended-upgrades has detected an incomplete package operation from a previous system state. The dpkg package manager maintains a database of package states, and when an installation, upgrade, or removal is interrupted before completion, dpkg is left in a state where some packages are unpacked but not fully configured. When unattended-upgrades runs and detects this condition, it stops and notifies you that the system cannot proceed with new upgrades until the interrupted operation is resolved.
How do I fix "unattended-upgrades: dpkg was interrupted, you must manually run 'dpkg"?
The "dpkg was interrupted" error occurs when unattended-upgrades detects that a previous package installation was not completed, leaving the system in an inconsistent state. This can happen after unexpected reboots, power failures, or system crashes during package operations. The fix involves running 'dpkg --configure -a' to complete any pending package configurations and restore system consistency.
What causes "unattended-upgrades: dpkg was interrupted, you must manually run 'dpkg"?
Unexpected system reboot during unattended-upgrades package operations, leaving packages in a partially-installed state Power failure or unexpected shutdown while apt was installing or configuring packages Manual interruption (Ctrl+C) of apt or dpkg commands during package operations
Is the "unattended-upgrades: dpkg was interrupted, you must manually run 'dpkg" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading