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/dpkgpackage 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
-
On the affected device, repair the package database:
sudo dpkg --configure -a
-
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-upgradesrunning on its own schedule.
- A common holder is
-
Repair any broken dependencies left behind:
sudo apt-get install -f
-
Confirm the package system is healthy:
sudo apt-get update
- 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.