Package Management & Updates

dpkg has pending configuration after an interrupted transaction

An interrupted install can leave packages unpacked but unconfigured. Audit the recorded states before resuming scripts or removing packages.

On this page
  1. Symptoms & scope
  2. Possible causes
  3. Diagnose safely
  4. Evidence-guided next steps
  5. References & review
  6. Related problems

Symptoms & scope

  • APT asks for dpkg --configure -a before proceeding.
  • dpkg --audit lists unpacked or half-configured packages.

Relevant environment

Debian/Ubuntu dpkg and APT; configuration repair runs package scripts and may start or restart services.

Recognizable messages (synthetic examples)
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

Inspect pending state and exclude another active writer before resuming maintainer scripts.

Possible causes

These are possible explanations, not a confirmed diagnosis. Several independent faults can coexist.

  • An installation may have been stopped before post-install scripts and triggers completed.
  • A package-specific script or missing dependency may cause every retry to stop at the same package.

Diagnose safely

Run one command at a time in the relevant session. Read the explanation first. Uppercase placeholders need your own values; tools and privileges vary by distribution. These commands are displayed here and never executed by the website.

Check 1

Read-only consistency audit; does not configure, remove or reinstall packages.

dpkg --audit

Interpret the result: Unpacked and half-configured states identify pending work. No audit output does not prove that a previously failing service now starts.

Check 2

Replace PACKAGE_NAME with the first package named by the audit or failed transaction. Reads local status and dependency fields.

dpkg-query -s PACKAGE_NAME

Interpret the result: Status: install ok unpacked differs from installed or half-configured. Record the first script error separately; later dependency errors may be consequences.

Evidence-guided next steps

Resume the audited pending configuration

If no package writer is active and the audit confirms interrupted configuration, run dpkg --configure -a with administrator privileges in a terminal. Read prompts and the first failing script message rather than accepting repeated retries without investigating.

Precautions: This runs maintainer scripts and triggers, which can change service state. Preserve configuration and a pre-repair snapshot where service availability matters.

Recovery / rollback: Script effects have no universal undo. Restore saved service configuration or the coherent snapshot; do not edit /var/lib/dpkg/status manually.

Did this solution help you?

Share this solution#

Repair the first package-specific failure

If configuration repeatedly fails for the same package, identify its first error and fix the named missing dependency or invalid service configuration using that package’s documentation. If its files are damaged, preview an APT reinstall of that exact package before applying it and rerun pending configuration afterward.

Precautions: Do not force-remove essential packages or delete maintainer scripts to make the warning disappear.

Recovery / rollback: Restore the saved package configuration or supported matching package set; use the snapshot if a maintainer-script migration must be undone.

Did this solution help you?

Share this solution#

References & review

This guide was prepared from primary project or distribution sources and reviewed on the date shown. This is an editorial source check, not evidence that a fix was reproduced on your hardware. Diagnostic log examples are synthetic fixtures. Version-dependent details must be checked against your installed release.