Debian 8 openjdk-8-jre-headless 安装失败

Debian 8 openjdk-8-jre-headless 安装失败

我有一个虚拟机,用于测试 tomcat8 的功能。由于我的 PC 安装了 java8(我个人不想回退到 java7),我尝试在“服务器”虚拟机上安装 JRE 1.8。由于我运行的是 Debian 8(Jessie),我研究了如何安装并得出结论(查看,例如),我必须使用

sudo apt-get install -t jessie-backports openjdk-8-jre-headless

但是当我这样做时,我收到以下错误消息(对我来说这看起来像是一个 HTTP 错误):

Reading package lists...
Building dependency tree...
Reading state information...
openjdk-8-jre-headless is already the newest version.
The following packages were automatically installed and are no longer required:
libfontenc1 libxfont1
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 130 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up oracle-java8-installer (8u121-1~webupd8~2) ...
Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
Downloading Oracle Java 8...
converted 'http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz' (ANSI_X3.4-1968) -> 'http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz' (UTF-8)
--2017-03-23 12:03:57--  http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 95.101.114.65,95.101.114.75
Connecting to download.oracle.com (download.oracle.com)|95.101.114.65|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz [following]
converted 'https://edelivery.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz' (ANSI_X3.4-1968) -> 'https://edelivery.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz' (UTF-8)
--2017-03-23 12:03:58--  https://edelivery.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 2.23.14.19, 2001:41a8:26:18b::2d3e, 2001:41a8:26:19d::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|2.23.14.19|:443... failed: Connection refused.
Connecting to edelivery.oracle.com (edelivery.oracle.com)|2001:41a8:26:18b::2d3e|:443... failed: Network is unreachable.
Connecting to edelivery.oracle.com (edelivery.oracle.com)|2001:41a8:26:19d::2d3e|:443... failed: Network is unreachable.
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

我该如何解决这个问题?

答案1

从您的 apt-get 输出可以清楚地看出,OpenJDK 的 JRE 8 已经安装。

失败是由不同的软件包 oracle-java8-installer 引起的。它无法下载所需的文件,可能是因为您取消了安装并且已有较新的版本可用。

如果您不想要该包,请使用 将其删除apt-get remove <pkg>。如果您希望 Oracle JDK 与 OpenJDK 并行安装,那么您也应该将其删除,然后执行apt-get update最后的操作apt-get install <pkg>以接收更新的安装脚本。

相关内容