An essential troubleshooting guide for Sysadm.
Recently, I come across update error code 1 while updating my Ubuntu. And this isn’t the first time it happens.
It can be in different formats, such as:
subprocess installed post-installation script returned error exit status 10
E: Sub-process /usr/bin/dpkg returned an error code (1)
dpkg: error processing package dpkg (--configure):
installed dpkg package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
dpkg
Quick Resolution#
- Remove post info files of those troubleshome package.
$ sudo mv /var/lib/dpkg/info/dpkg.* /tmp
Note that package name can be others, such as openssh-server.*
or dpkg.*
.
- Use force install.
$ sudo apt install -f
- Reconfigure package database.
$ sudo dpkg --configure -a
Root Cause#
Most likely, the package got corrupted while installing a package. Usually reconfiguring fix the problem. And if a package installation was interrupted previously, then force installing is needed to resolve it.