web-dev-qa-db-fra.com

Impossible d'installer Oracle Java 8 dans Ubuntu 16.04

Je n’ai rien installé d’étrange sur mon serveur Ubuntu 16.04. J'ai fait quelques tests dans mon bureau Ubuntu 16.04 VM quelques heures auparavant et l'installation a été un succès, mais dans ma version dédiée, quelque chose ne va pas.

Explication:

  1. J'ai réinstallé le système d'exploitation sur mon ordinateur dédié de Windows à Linux (Ubuntu Server 16.04)

  2. Juste ouvrir SSH première fois, je vais pour

    Sudo apt-get update
    Sudo apt-get upgrade
    
  3. Ensuite, j'ai essayé d'installer Oracle Java 8

    $ Sudo add-apt-repository ppa:webupd8team/Java
     Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK7 /
    
    Important -> Why Oracle Java 7 And 6 Installers No Longer Work: http://www.webup
    
    Ubuntu 16.10 Yakkety Yak is no longer supported by Canonical (and thus, Launchpad)
    
    More info (and Ubuntu installation instructions):
    - for Oracle Java 7: http://www.webupd8.org/2012/01/install-Oracle-Java-jdk-7-in
    - for Oracle Java 8: http://www.webupd8.org/2012/09/install-Oracle-Java-8-in-ubu
    
    Debian installation instructions:
    - Oracle Java 7: http://www.webupd8.org/2012/06/how-to-install-Oracle-Java-7-in-
    - Oracle Java 8: http://www.webupd8.org/2014/03/how-to-install-Oracle-Java-8-in-
    
    Oracle Java 9 (for both Ubuntu and Debian): http://www.webupd8.org/2015/02/insta
    
    Oracle JDK 9 is now considered stable. There are currently only 64bit builds (nodownloads/index.html )
     More info: https://launchpad.net/~webupd8team/+archive/ubuntu/Java
    Press [ENTER] to continue or ctrl-c to cancel adding it
    
    gpg: keyring `/tmp/tmp64tvseig/secring.gpg' created
    gpg: keyring `/tmp/tmp64tvseig/pubring.gpg' created
    gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
    gpg: /tmp/tmp64tvseig/trustdb.gpg: trustdb created
    gpg: key EEA14886: public key "Launchpad VLC" imported
    gpg: no ultimately trusted keys found
    gpg: Total number processed: 1
    gpg:               imported: 1  (RSA: 1)
    

    puis

    $ Sudo apt update; Sudo apt install Oracle-Java8-installer
    Sudo apt update; Sudo apt install Oracle-
    Hit:1 http://mirror.hetzner.de/ubuntu/packages xenial InRelease
    Hit:2 http://mirror.hetzner.de/ubuntu/packages xenial-backports InRelease
    Hit:3 http://mirror.hetzner.de/ubuntu/packages xenial-updates InRelease
    Hit:4 http://mirror.hetzner.de/ubuntu/security xenial-security InRelease
    Get:5 http://ppa.launchpad.net/webupd8team/Java/ubuntu xenial InRelease [17.5 kB
    Hit:6 http://de.archive.ubuntu.com/ubuntu xenial InRelease
    Hit:7 http://de.archive.ubuntu.com/ubuntu xenial-updates InRelease
    Hit:8 http://de.archive.ubuntu.com/ubuntu xenial-backports InRelease
    Get:9 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
    Get:10 http://ppa.launchpad.net/webupd8team/Java/ubuntu xenial/main AMD64 Packag
    Get:11 http://ppa.launchpad.net/webupd8team/Java/ubuntu xenial/main i386 Package
    Get:12 http://ppa.launchpad.net/webupd8team/Java/ubuntu xenial/main Translation-
    Fetched 126 kB in 0s (175 kB/s)
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    2 packages can be upgraded. Run 'apt list --upgradable' to see them.
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following additional packages will be installed:
      binutils gsfonts gsfonts-x11 Java-common libfontenc1 libxfont1 Oracle-Java8-se
    Suggested packages:
      binutils-doc binfmt-support visualvm ttf-baekmuk | ttf-unfonts | ttf-unfonts-c
      ttf-arphic-uming firefox | firefox-2 | iceweasel | mozilla-firefox | iceape-br
      | midbrowser | moblin-web-browser | xulrunner | xulrunner-1.9 | konqueror | ch
    The following NEW packages will be installed:
      binutils gsfonts gsfonts-x11 Java-common libfontenc1 libxfont1 Oracle-Java8-in
    0 upgraded, 11 newly installed, 0 to remove and 2 not upgraded.
    Need to get 6,519 kB of archives.
    After this operation, 20.5 MB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 http://mirror.hetzner.de/ubuntu/packages xenial-updates/main AMD64 binutil
    Get:2 http://ppa.launchpad.net/webupd8team/Java/ubuntu xenial/main AMD64 Oracle-
    Get:3 http://ppa.launchpad.net/webupd8team/Java/ubuntu xenial/main AMD64 Oracle-
    Get:4 http://mirror.hetzner.de/ubuntu/packages xenial/main AMD64 Java-common all
    Get:5 http://mirror.hetzner.de/ubuntu/packages xenial/main AMD64 gsfonts all 1:8
    Get:6 http://mirror.hetzner.de/ubuntu/packages xenial/main AMD64 libfontenc1 AMD
    Get:7 http://mirror.hetzner.de/ubuntu/packages xenial-updates/main AMD64 libxfon
    Get:8 http://mirror.hetzner.de/ubuntu/packages xenial/main AMD64 x11-common all
    Get:9 http://mirror.hetzner.de/ubuntu/packages xenial/main AMD64 xfonts-encoding
    Get:10 http://mirror.hetzner.de/ubuntu/packages xenial-updates/main AMD64 xfonts
    Get:11 http://mirror.hetzner.de/ubuntu/packages xenial/universe AMD64 gsfonts-x1
    Fetched 6,519 kB in 0s (24.8 MB/s)
    Preconfiguring packages ...
    Selecting previously unselected package binutils.
    (Reading database ... 57317 files and directories currently installed.)
    Preparing to unpack .../binutils_2.26.1-1ubuntu1~16.04.5_AMD64.deb ...
    Unpacking binutils (2.26.1-1ubuntu1~16.04.5) ...
    Selecting previously unselected package Java-common.
    Preparing to unpack .../Java-common_0.56ubuntu2_all.deb ...
    Unpacking Java-common (0.56ubuntu2) ...
    Processing triggers for libc-bin (2.23-0ubuntu9) ...
    Processing triggers for man-db (2.7.5-1) ...
    Setting up binutils (2.26.1-1ubuntu1~16.04.5) ...
    Processing triggers for libc-bin (2.23-0ubuntu9) ...
    Selecting previously unselected package Oracle-Java8-installer.
    (Reading database ... 57533 files and directories currently installed.)
    Preparing to unpack .../Oracle-Java8-installer_8u144-1~webupd8~0_all.deb ...
    Unpacking Oracle-Java8-installer (8u144-1~webupd8~0) ...
    Processing triggers for shared-mime-info (1.5-2ubuntu0.1) ...
    Processing triggers for mime-support (3.59ubuntu1) ...
    Setting up Java-common (0.56ubuntu2) ...
    Setting up Oracle-Java8-installer (8u144-1~webupd8~0) ...
    No /var/cache/Oracle-jdk8-installer/wgetrc file found.
    Creating /var/cache/Oracle-jdk8-installer/wgetrc and
    using default Oracle-Java8-installer wgetrc settings for it.
    Downloading Oracle Java 8...
    --2017-10-18 19:34:47--  http://download.Oracle.com/otn-pub/Java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
    Resolving download.Oracle.com (download.Oracle.com)... 2.20.189.226, 2.20.190.214
    Connecting to download.Oracle.com (download.Oracle.com)|2.20.189.226|:80... connected.
    HTTP request sent, awaiting response... 302 Moved Temporarily
    Location: https://edelivery.Oracle.com/otn-pub/Java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz [following]
    --2017-10-18 19:34:47--  https://edelivery.Oracle.com/otn-pub/Java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
    Resolving edelivery.Oracle.com (edelivery.Oracle.com)... 2a02:26f0:78:18e::2d3e, 2a02:26f0:78:196::2d3e, 104.108.49.101
    Connecting to edelivery.Oracle.com (edelivery.Oracle.com)|2a02:26f0:78:18e::2d3e|:443... connected.
    HTTP request sent, awaiting response... 302 Moved Temporarily
    Location: http://download.Oracle.com/otn-pub/Java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508348207_951d79ba516ffabdf4dcbded7e76c54f [following]
    --2017-10-18 19:34:47--  http://download.Oracle.com/otn-pub/Java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508348207_951d79ba516ffabdf4dcbded7e76c54f
    Connecting to download.Oracle.com (download.Oracle.com)|2.20.189.226|:80... connected.
    HTTP request sent, awaiting response... 404 Not Found
    2017-10-18 19:34:48 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)**
    

    Ces sortie dit à la fin:

    **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)**
    

Peut-être que je devrais essayer d'installer Oracle JDK 8?

20
Ubuntu Noob

Selon ce fil sur les forums Ubunt , cela semble être un problème du côté de WebUpd8.

Jusqu'à ce qu'ils le résolvent, installez-le manuellement:

https://docs.Oracle.com/javase/8/docs/technotes/guides/install/linux_jdk.html

11
Pedro Galvao

Ce problème est survenu à nouveau car la version 161 a été archivée. Cette version est actuellement référencée par le PPA. Vous pouvez utiliser les commandes suivantes pour mettre à jour la référence à 172 (171 + corrections de bugs, reportez-vous à la section Téléchargements Java d'Oracle1):

cd /var/lib/dpkg/info

Sudo sed -i 's|Java_VERSION=8u161|Java_VERSION=8u172|' Oracle-Java8-installer.*
Sudo sed -i 's|PARTNER_URL=http://download.Oracle.com/otn-pub/Java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/|PARTNER_URL=http://download.Oracle.com/otn-pub/Java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/|' Oracle-Java8-installer.*
Sudo sed -i 's|SHA256SUM_TGZ="6dbc56a0e3310b69e91bb64db63a485bd7b6a8083f08e48047276380a0e2021e"|SHA256SUM_TGZ="28a00b9400b6913563553e09e8024c286b506d8523334c93ddec6c9ec7e9d346"|' Oracle-Java8-installer.*
Sudo sed -i 's|J_DIR=jdk1.8.0_161|J_DIR=jdk1.8.0_172|' Oracle-Java8-installer.*

puis courir

Sudo apt-get install Oracle-Java8-installer

1 Java SE 8u172 est une mise à jour d'un ensemble de correctifs, comprenant tous les correctifs de 8u171, ainsi que des corrections de bogues supplémentaires (décrites dans les notes de version ).

33
Gerwin Koudijs

On dirait que le problème est que le PPA tente de télécharger Java8U144, qui est maintenant une version archivée, de sorte que l'URL est différente (accessible via http://download.Oracle.com/otn/ pas http://download.Oracle.com/otn-pub/).

Les seules versions non archivées et accessibles via otn-pub sont les versions 151 et 152.

Vous pouvez utiliser cette solution de contournement temporaire jusqu'à ce qu'ils résolvent ce problème de leur côté.

basculer vers le répertoire dpkg

cd /var/lib/dpkg/info

Puis exécutez les commandes suivantes: -

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.*
9
Anurag Sinha