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.
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
- Read the lines above for the failing package and reason
- sudo dpkg --configure -a then sudo apt -f install
- Fix the underlying service/config error and retry
Detailed fix by platform
Ubuntu
- bash
sudo dpkg --configure -a sudo apt-get -f install sudo journalctl -xe | tail -30 # if a service failed in postinst
How to diagnose
- Package — Which one failed?
- Reason — Message above (conflict, service, disk)
- 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:
Similar errors
- dpkg lock E: Could not get lock /var/lib/dpkg/lock-frontend — is another process using it?
- dpkg was interrupted E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem
- Failed to download metadata for repo Error: Failed to download metadata for repo 'appstream' (dnf / yum)
Most viewed in Linux
Other ways to find it
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026