Problem with openjdk-8-jre upgrade

I am suddenly getting this error while trying to update my Ubuntu 20.04 system.

The following packages have unmet dependencies: openjdk-8-jre:i386 : Depends: openjdk-8-jre-headless:i386 (= 8u272-b10-0ubuntu1~20.04) but 8u265-b01-0ubuntu2~20.04 is installed openjdk-8-jre-headless : Breaks: openjdk-8-jre-headless:i386 (!= 8u272-b10-0ubuntu1~20.04) but 8u265-b01-0ubuntu2~20.04 is installed openjdk-8-jre-headless:i386 : Breaks: openjdk-8-jre-headless (!= 8u265-b01-0ubuntu2~20.04) but 8u272-b10-0ubuntu1~20.04 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Trying 'apt --fix-broken install' gives this output:

Preparing to unpack .../openjdk-8-jre-headless_8u272-b10-0ubuntu1~20.04_i386.deb ...
Unpacking openjdk-8-jre-headless:i386 (8u272-b10-0ubuntu1~20.04) over (8u265-b01-0ubuntu2~20.04) ...
dpkg: error processing archive /var/cache/apt/archives/openjdk-8-jre-headless_8u272-b10-0ubuntu1~20.04_i386.deb (--unpack): trying to overwrite shared '/etc/java-8-openjdk/security/java.security', which is different from other instances of package openjdk-8-jre-headless:i386
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing: /var/cache/apt/archives/openjdk-8-jre-headless_8u272-b10-0ubuntu1~20.04_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm not sure what this means or what to do to clear this error. Any advice? Thanks.

1 Answer

This issue seem to stem from the conflict between the OpenJDK and Oracle's own DEB distributions for Focal, especially if you've used the webupd8 PPA in the past to install it. I solved it by forcing the override:

sudo apt -o Dpkg::Options::="--force-overwrite" --fix-broken install

You can also force it directly with dpkg by running

sudo dpkg --configure --force-overwrite -a

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like