Sub-process /usr/bin/dpkg returned an error code (1) Linux Origin: Platform & cloud OSI layer 7 · Application Last updated 14 Oct 2026

E: Sub-process /usr/bin/dpkg returned an error code (1)

A package’s install/configure script failed, so dpkg aborted. The real error is a few lines above this message.

Exact message you may see Sub-process /usr/bin/dpkg returned an error code (1)dpkg: error processing packageinstalled post-installation script subprocess returned error exit statustrying to overwrite
Seen on: Linux

Meaning

dpkg runs maintainer scripts (postinst etc.). They fail when a service can’t start after install (port in use, bad config), a file conflicts with another package, or disk is full. The package stays half-configured until fixed.

Common causes

  • Package’s post-install script failed (service failed to start)
  • File conflict with another package (trying to overwrite)
  • Disk full during unpack
  • Broken previous install

⚡ Quick fix

  1. Read the lines above for the failing package and reason
  2. sudo dpkg --configure -a then sudo apt -f install
  3. Fix the underlying service/config error and retry

Detailed fix by platform

Ubuntu

  1. bash
    sudo dpkg --configure -a
    sudo apt-get -f install
    sudo journalctl -xe | tail -30   # if a service failed in postinst

How to diagnose

  1. Package — Which one failed?
  2. Reason — Message above (conflict, service, disk)
  3. Disk — df -h

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

dpkg lock — E: Could not get lock /var/lib/dpkg/lock-frontend — is another process using it? (Linux)dpkg lockdpkg was interrupted — E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem (Linux)dpkg was interruptedFailed to download metadata for repo — Error: Failed to download metadata for repo 'appstream' (dnf / yum) (Linux)Failed to download me…held broken packages — Unmet dependencies / E: Unable to correct problems, you have held broken packages (Linux)held broken packagesNO_PUBKEY — The following signatures couldn't be verified because the public key is not available: NO_PUBKEY (Linux)NO_PUBKEYRepository does not have a Release file — E: The repository '...' does not have a Release file (Linux)Repository does not h…Unable to locate package — E: Unable to locate package (apt / apt-get install) (Linux)Unable to locate pack…Sub-proce…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.