webupd8 oracle-java-7-installer失败404


21

我正在尝试在Docker映像中安装java7。这一直工作到几天前。命令是:

    apt-get --fix-missing update
    apt-get -y upgrade

    apt-get -y install software-properties-common
    add-apt-repository ppa:webupd8team/java
    apt-get -y upgrade
    apt-get -y update

    echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
    apt-get install -y oracle-java7-installer

输出为:

       Setting up oracle-java7-installer (7u80+7u60arm-0~webupd8~1) ...
       debconf: unable to initialize frontend: Dialog
       debconf: (TERM is not set, so the dialog frontend is not usable.)
       debconf: falling back to frontend: Readline
       debconf: unable to initialize frontend: Readline
       debconf: (This frontend requires a controlling tty.)
       debconf: falling back to frontend: Teletype
       Downloading Oracle Java 7...
       --2017-05-29 16:54:29--  http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
       Resolving download.oracle.com (download.oracle.com)... 104.96.220.162, 104.96.220.106
       Connecting to download.oracle.com (download.oracle.com)|104.96.220.162|:80... connected.
       HTTP request sent, awaiting response... 302 Moved Temporarily
       Location: (REMOVING H-T-T-P-S BECAUSE I DON'T HAVE ENOUGH REP POINTS)://edelivery.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz [following]
       --2017-05-29 16:54:29--  (REMOVING H-T-T-P-S BECAUSE I DON'T HAVE ENOUGH REP POINTS)://edelivery.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
       Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.196.115.62, 2600:1408:10:184::2d3e, 2600:1408:10:185::2d3e
       Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.196.115.62|:443... connected.
       HTTP request sent, awaiting response... 302 Moved Temporarily
       Location: (REMOVING H-T-T-P BECAUSE I DON'T HAVE ENOUGH REP POINTS)//download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1496076904_47c6805122b1f8131f00e210452116ca [following]
       --2017-05-29 16:54:29--  http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1496076904_47c6805122b1f8131f00e21                                                0452116ca
       Connecting to download.oracle.com (download.oracle.com)|104.96.220.162|:80... connected.
       HTTP request sent, awaiting response... 404 Not Found
       2017-05-29 16:54:31 ERROR 404: Not Found.

       download failed
       Oracle JDK 7 is NOT installed.
       dpkg: error processing package oracle-java7-installer (--configure):
       subprocess installed post-installation script returned error exit status 1
       Setting up gsfonts (1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1) ...
       Setting up x11-common (1:7.7+1ubuntu8.1) ...
       debconf: unable to initialize frontend: Dialog
       debconf: (TERM is not set, so the dialog frontend is not usable.)
       debconf: falling back to frontend: Readline
       debconf: unable to initialize frontend: Readline
       debconf: (This frontend requires a controlling tty.)
       debconf: falling back to frontend: Teletype
       invoke-rc.d: policy-rc.d denied execution of start.
       Processing triggers for ureadahead (0.100.0-16) ...
       Setting up xfonts-encodings (1:1.0.4-1ubuntu1) ...
       Setting up xfonts-utils (1:7.7+1) ...
       Setting up gsfonts-x11 (0.22) ...
       Processing triggers for libc-bin (2.19-0ubuntu6.9) ...
       Errors were encountered while processing:
        oracle-java7-installer
       E: Sub-process /usr/bin/dpkg returned an error code (1)
       The command '/bin/sh -c apt-get install -y oracle-java7-installer'            returned a non-zero code: 100

他们有简单的PPA的方式,我不知道为什么你尝试过类似这样的命令echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections简单sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer
埃格SUCU

您所说的简单的PPA方法是什么?这是使用webupd8方法。这正是oracle-java7-installer的来源。
TobisTobogan '17

1
我也有完全一样的问题。PPA似乎没有数据,或者下载文件的URL已更改。
headmyshoulder

您可能会遇到我在这里回答的问题:stackoverflow.com/questions/44213454/…–
doz10us

向维护者发送了电子邮件,他说他们不会修复。因此,如果要继续使用webupd8 PPA,请升级到JDK8,或者手动下载并安装它。
dvdgsng

Answers:


15

错误的原因是Oracle从其站点中删除了二进制文件。尽管前一版本已弃用这些版本,但是二进制文件仍然可以下载直到最近。但是他们现在将其删除。

2017年6月2日在webupd8的网站中对此进行了解释。甲骨文的下载页面

2015年4月之后发布的Java SE 7更新和2013年4月之后发布的Java SE 6更新仅对Oracle客户通过My Oracle Support(需要支持登录)可用。

Java SE Advanced为用户提供了商业功能,可以访问关键的错误修复程序,安全修复程序和常规维护”。

在此处查看完整的详细信息http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.html


那么,旧软件的依赖关系(指向Java 7)又如何呢?

@Dee您在说什么软件?没有软件应该明确地依赖于java7,但是如果您找到了它,我可以添加有关如何使它工作的详细信息。
安瓦尔

22

由于Oracle已移动了下载链接,并且需要登录凭据才能下载Java的较早版本,请按照以下步骤安装Java 7:

1)从http://www.oracle.com/technetwork/java/javase/下载最新的Java版本。 downloads / java-archive-downloads-javase7-521261.html。您需要登录。

2)从/ var / cache / oracle-jdk7-installer /中删除jdk-7uXX-linux-x64.tar.gz,其中XX是版本号。 3)使用以下命令将下载的版本移至/ var / cache / oracle-jdk7-installer /

sudo mv jdk-7u(downloadedversion)-linux-x64.tar.gz /var/cache/oracle-jdk7-installer/


4)现在运行以下命令

sudo apt-get install oracle-java7-installer




1
跟随许多职位没有任何工作。第三步做魔术。
Anupama Boorlagadda

什么时候是执行覆盖的正确时间?在apt-get install -y oracle-java7-installer之前?显然,目前还没有安装程序,那么我该如何安装jdk?如果执行安装,它将失败。我只能下载该软件包,但仍然无法解压缩,因此/ var / cache中没有文件对吗?
MorioBoncz

这行不通。它只是说E: Package 'oracle-java7-installer' has no installation candidate
八月Lilleaas

@AugustLilleaas首先你需要添加实际PPA看到原来的答案,然后apt-get的更新,然后你就会有包
alonisser

不幸的是,添加PPA并没有帮助。我添加了add-apt-repository ppa:webupd8team/java,并且该回购没有提供oracle-java7-installer软件包
August Lilleaas,

0

如其他答案所述,Oracle需要开发人员帐户或支持合同才能从其站点下载除最新版本的JRE / JDK之外的任何内容,因为Oracle通常会发布以解决严重的CVE(漏洞)问题。

该存储库具有一个脚本,该脚本可让您根据设置的参数和环境变量下载最新或更旧的版本。

https://github.com/vjkoskela/jdk-wrapper


0

我想在这里发布,以防万一有人遇到了Oracle从昨天的Java 181升级到191的问题。如果您在使用Java 8时遇到此问题,请在此处查找修补程序,直到为Ubuntu更新了新的Java 8安装程序。

这是181至191的解决方法:

cd /var/lib/dpkg/info
sudo sed -i 's|JAVA_VERSION=8u181|JAVA_VERSION=8u191|' oracle-java8-installer.*
sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/|' oracle-java8-installer.*
sudo sed -i 's|SHA256SUM_TGZ="1845567095bfbfebd42ed0d09397939796d05456290fb20a83c476ba09f991d3"|SHA256SUM_TGZ="53c29507e2405a7ffdbba627e6d64856089b094867479edc5ede4105c1da0d65"|' oracle-java8-installer.*
sudo sed -i 's|J_DIR=jdk1.8.0_181|J_DIR=jdk1.8.0_191|' oracle-java8-installer.* 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.