Ubuntu 16.04에서 Oracle Java 8을 설치할 수 없습니다


20

우분투 16.04 서버에 이상한 것을 설치하지 않았습니다. 몇 시간 전에 Ubuntu 16.04 Desktop VM에서 몇 가지 테스트를 수행하여 설치에 성공했지만 전용에는 문제가있는 것 같습니다.

설명:

  1. Windows에서 Linux로 전용 OS를 다시 설치했습니다 (Ubuntu Server 16.04)

  2. SSH를 처음 열면

    sudo apt-get update
    sudo apt-get upgrade
    
  3. 그런 다음 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)
    

    그때

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

    이 출력은 마지막에 말합니다.

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

Oracle JDK 8을 설치해야합니까?

답변:


11

우분투 포럼 의이 스레드에 따르면 WebUpd8의 측면에서 문제가되는 것 같습니다.

그들이 고칠 때까지 수동으로 설치하십시오.

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


다운로드 링크는 어디에 있습니까? 단지 지침이 있습니다.
Ubuntu Noob


우분투 x64 서버의 경우 rpm 또는 witouth rpm입니까?
Ubuntu Noob

RPM은 "Red Hat Package Manager"를 나타냅니다. 배포판이 Red Hat 인 경우 사용하십시오. 그렇지 않으면 DEB로 이동
Pedro Galvao

1
현재이 링크 (@PedroGalvao 답변 향상)는 오류가 발생한 후 Java 8을 설치하기 위해 실행해야하는 명령을 제공합니다.
paulochf

33

버전 161이 아카이브되었으므로이 문제가 다시 발생했습니다. 이 버전은 현재 PPA에서 참조합니다. 다음 명령을 사용하여 참조를 172 (171 개 이상의 버그 수정, Oracle의 Java 다운로드 1 참조)로 업데이트 할 수 있습니다 .

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

그런 다음 실행

sudo apt-get install oracle-java8-installer

1 Java SE 8u172는 모든 8u171과 추가 버그 수정 ( 릴리스 노트에 설명)을 포함한 패치 세트 업데이트 입니다.


Oracle Java 다운로드 사이트에 아카이브되는 현재 대상 버전을 기반으로 새 apt-package 빌드를 자동화 할 수 있는지 궁금합니다.
Russ Cam

9

문제는 PPA가 현재 아카이브 된 버전 인 java8U144를 다운로드하려고하므로 URL이 다릅니다 ( http://download.oracle.com/otn/not 를 통해 액세스 할 수 있음 http://download.oracle.com/otn-pub/)

otn-pub을 통해 보관 및 액세스 할 수없는 유일한 버전은 151 및 152입니다.

이 임시 해결 방법은 문제가 해결 될 때까지 사용할 수 있습니다.

dpkg 디렉토리로 전환

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

2
이것은 152를 설치하고 @ gerwin-koudijs의 답변에있는 161을 사용할 수도 있습니다 : askubuntu.com/a/996986/754455
Ryan Fisher
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.