Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

oracle-java8-installer Webupd8 PPA 404 Not Found

The following error is thrown when you execute sudo apt-get install oracle-java8-installer:

Location: http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508340360_7be4aa21e145dd26bda475add7c27ada [following]
                    --2017-10-18 08:24:00--  http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508340360_7be4aa21e145dd26bda475add7c27ada
                    Reusing existing connection to 2.2.0.1:8080.
                    Proxy request sent, awaiting response... 404 Not Found

A temporarily workaround is:

cd /var/lib/dpkg/info
sudo sed -i 's|JAVA_VERSION=8u144|JAVA_VERSION=8u152|' oracle-java8-installer.*
sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/|' oracle-java8-installer.*
sudo sed -i 's|SHA256SUM_TGZ="e8a341ce566f32c3d06f6d0f0eeea9a0f434f538d22af949ae58bc86f2eeaae4"|SHA256SUM_TGZ="218b3b340c3f6d05d940b817d0270dfe0cfd657a636bad074dcabe0c111961bf"|' oracle-java8-installer.*
sudo sed -i 's|J_DIR=jdk1.8.0_144|J_DIR=jdk1.8.0_152|' oracle-java8-installer.*
like image 998
Zile Rehman Avatar asked Oct 29 '22 00:10

Zile Rehman


1 Answers

From https://ubuntuforums.org/showthread.php?t=2374686 below is reported the ansible playbook to install oracle-java8-installer implementing the workaround illustrated in the above answer (also coming from the same source, supposedly).

---

- name: Add Oracle Java webupd PPA
  apt_repository:
    repo: "ppa:webupd8team/java"


- name: Accept Java licence
  debconf:
    name: "oracle-java{{ java.version }}-installer"
    question: shared/accepted-oracle-license-v1-1
    vtype: select
    value: "true"


# - name: Install Oracle Java
#   apt:
#     name: "{{ item }}"
#     update_cache: yes
#     state: latest
#     force: yes
#   with_items:
#     - "oracle-java{{ java.version }}-installer"
#     - "oracle-java{{ java.version }}-set-default"


# Temporary fix for webupd8team installer issue
- name: Install Oracle Java
  block:
    - apt:
        name: "{{ item }}"
        update_cache: yes
        state: latest
        force: yes
      with_items:
        - "oracle-java{{ java.version }}-installer"
        - "oracle-java{{ java.version }}-set-default"
  rescue:
    - shell: cd /var/lib/dpkg/info && sudo sed -i 's|JAVA_VERSION=8u144|JAVA_VERSION=8u152|' oracle-java8-installer.*
    - shell: cd /var/lib/dpkg/info && sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/|' oracle-java8-installer.*
    - shell: cd /var/lib/dpkg/info && sudo sed -i 's|SHA256SUM_TGZ="e8a341ce566f32c3d06f6d0f0eeea9a0f434f538d22af949ae58bc86f2eeaae4"|SHA256SUM_TGZ="218b3b340c3f6d05d940b817d0270dfe0cfd657a636bad074dcabe0c111961bf"|' oracle-java8-installer.*
    - shell: cd /var/lib/dpkg/info && sudo sed -i 's|J_DIR=jdk1.8.0_144|J_DIR=jdk1.8.0_152|' oracle-java8-installer.*
  always:
    - apt:
        name: "{{ item }}"
      with_items:
        - "oracle-java{{ java.version }}-installer"
        - "oracle-java{{ java.version }}-set-default"
like image 95
spac Avatar answered Oct 31 '22 13:10

spac