Upgrade Failed Error for dpkg Interruption

Issue

A patch deployment or agent upgrade on a Debian-based Linux device fails, and the Activity Log (or the device terminal) shows:

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

Environment

  • Automox agent on Debian-based distributions (Ubuntu, Debian)
  • apt / dpkg package management

Overview

dpkg keeps a database of package state. When a package operation is interrupted partway through — a reboot or shutdown during an install, another process holding the package lock (for example, an unattended-upgrades run colliding with the patch window), or the disk filling mid-install — that database is left mid-transaction. Every subsequent package operation, including Automox patch deployments, refuses to run until the database is repaired. The error is reported by apt itself; Automox is surfacing it, not causing it.

Resolution

  1. On the affected device, repair the package database:

    sudo dpkg --configure -a
  2. If the command reports that the lock is held (/var/lib/dpkg/lock-frontend), identify the competing process and let it finish or stop it:

    sudo fuser -v /var/lib/dpkg/lock-frontend
    • A common holder is unattended-upgrades running on its own schedule.
  3. Repair any broken dependencies left behind:

    sudo apt-get install -f
  4. Confirm the package system is healthy:

    sudo apt-get update
  5. In the Automox console, run Scan Device on the affected device, then re-run the patch policy (or wait for its next scheduled run).

Notes

  • If the error recurs on the same device, check for:
    • Low disk space interrupting installs partway through.
    • unattended-upgrades (or another configuration-management tool) patching on a schedule that overlaps the Automox patch window — stagger the two so only one package operation runs at a time.
  • If the Automox agent itself fails to upgrade after the database is repaired, reboot the device and retry.
  • Agent-side details of the failed run are in the agent log — see Reading Automox Agent Log Files.
Was this article helpful?
0 out of 0 found this helpful