Oracle Connection Issue – Unable to Connect for Java 8 on Ubuntu

aptjavalinuxUbuntu

I've been working with setting up a few servers over the past week using Ansible. Everything has been humming along fine until today a couple of hours ago the java8 playbook I had been using quit working randomly. I haven't touched it or looked at it in weeks. I even did git checkout to a known working version, still doesn't work.

The problem is almost verbatim the same as this one https://stackoverflow.com/questions/46815897/jdk-8-is-not-installed-error-404-not-found where I'm getting a 404 every time I try to run sudo apt-get install oracle-java8-installer. It also tries to download java8 on other commands like sudo apt autoremove and I always see the same error –

HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz?AuthParam=1531861842_cbe60a307e0051ef681fa0cef4e500ce [following]
--2018-07-17 21:08:42--  http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz?AuthParam=1531861842_cbe60a307e0051ef681fa0cef4e500ce
Connecting to download.oracle.com (download.oracle.com)|23.40.18.106|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-07-17 21:08:42 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)

I've tried everything listed in the SO question above and many other solutions I found elsewhere. I'm beginning to think my IP is blocked or oracle is having some issues on their end, am I missing something?

Best Answer

I was having that same error as well. Until the people at WebUpd8 update their package you need to edit it yourself. I used the answer you linked to, just with the new data:

cd /var/lib/dpkg/info
sed -i 's|JAVA_VERSION=8u171|JAVA_VERSION=8u181|' oracle-java8-installer.*
sed -i 's|J_DIR=jdk1.8.0_171|J_DIR=jdk1.8.0_181|' oracle-java8-installer.*
sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/|' oracle-java8-installer.*
sed -i 's|SHA256SUM_TGZ="b6dd2837efaaec4109b36cfbb94a774db100029f98b0d78be68c27bec0275982"|SHA256SUM_TGZ="1845567095bfbfebd42ed0d09397939796d05456290fb20a83c476ba09f991d3"|' oracle-java8-installer.*
Related Topic