Archive March 2021

How to fix failed Java JDK/JRE install on Debian/Ubuntu dpkg error

It's one of those issues, where the fix is simple and dumb, but hard to find. I was struggling to install default-jre package on Debian 10 Docker container (I suspect it's the same on some versions of Ubuntu). I always got the same error at the end:

Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried with different packages default-jdk, default-jreopenjdk-11-jre-headlessopenjdk-8-jre-headless and the result was the same.