How Do You Troubleshoot dpkg Errors from apt Commands like “package post-installation script subprocess returned error exit status 1”?

Problem scenario
On a Debian/Ubuntu server, you are trying to run apt commands. But you get errors like this:

dpkg: error processing package oracle-java11-installer-local (--configure):
installed oracle-java11-installer-local package post-installation script subprocess returned error exit status 1
Setting up nmap-common (7.80+dfsg1-2build1) …
Setting up liblua5.3-0:amd64 (5.3.3-1.1ubuntu2) …
dpkg: dependency problems prevent configuration of default-jre-headless:
default-jre-headless depends on openjdk-11-jre-headless; however:
Package openjdk-11-jre-headless is not installed.
Package oracle-java11-installer-local which provides openjdk-11-jre-headless is not configured yet.

dpkg: error processing package default-jre-headless (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of default-jre:
default-jre depends on default-jre-headless (= 2:1.11-72); however:
Package default-jre-headless is not configured yet.
Version of default-jre-headless on system, provided by oracle-java11-installer-local:amd64, is .
default-jre depends on openjdk-11-jre; however:
Package openjdk-11-jre is not installed.
Package oracle-java11-installer-local which provides openjdk-11-jre is not configured yet.

What should you do?

Solution
Remove oracle-java11-installer-local. Run a command like this: sudo apt -y remove oracle-java11-installer-local

Leave a comment

Your email address will not be published. Required fields are marked *