I just recently upgraded from 17.04 to 17.10, but in doing so ubuntu semes to have "forgotten" about my JDK 8 installation.
I can still use java:
olian04:~$ java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.17.10.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
But whenever i atempt to install a package, or clean away unused ones, I'm greeted by this:
Connecting to download.oracle.com (download.oracle.com)|92.122.94.143|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-01-20 16:35:41 ERROR 404: Not Found.
download failed
Oracle JDK 8 is NOT installed.
dpkg: error processing package oracle-java8-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
So my question is, how would i fix this? I'm fine with either purging the old version and reinstalling it again, or hooking up my actual java install with ubuntu again ("reminding" it where java is installed) or just leaving the faulty java 8 install behind and grabbing a new java 9. I just have no idea how to do any of this...
I've tried just installing openjdk-9-jdk
but since I'm not allowed to install any packaged without Java complaining about JDK 8 not being installed.... I'm kind of out of ideas...
The version of Java 8 that WebUpd8 provides (8u151) is outdated and no longer provided by Oracle, so it gives an HTTP 404 (not found) error. Here's another answer that provides a temporary fix:
This problem occurred again because version 151 has been archived. This version is referenced currently by the PPA. You can use the following commands to update the reference to 161:
Then, try
sudo apt update; sudo apt upgrade
.You could try to get your apt in order with
apt-get install --fix-broken
if that doesn help, we can go deeper, to
dpkg
dpkg -P oracle-java8-installer
or
dpkg -r -P openjdk-8-jdk
whatever the exact package name is ! You can see all your packages with
dpkg -l
and
grep
for java or jdkOnce you have removed the faulty install and apt is content again, you can do a fresh install of either java8 or java9.