apt-get install jdk8 失败

时间:2022-12-16 12:50:58

背景:elasticsearch 需要安装jdk8

apt-cache search java | grep jdk   # 无版本8
apt-get update   # 更新后执行,仍没有

add-apt-repository ppa:webupd8team/java
apt-get update    #更新系统,刷新软件源
apt-get install oracle-java8-installer   
#网络来源 https://blog.csdn.net/infoflow/article/details/77856088

 

 报错:

Downloading Oracle Java 8... --2018-06-12 10:49:41-- http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz Connecting to 10.0.10.117:3142... connected. Proxy request sent, awaiting response... 501 Redirected to invalid target 2018-06-12 10:49:41 ERROR 501: Redirected to invalid target.
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 原来下载地址无法下载
apt-get install jdk8 失败
JRE Expiration Date
The JRE expires whenever a new release with security vulnerability fixes becomes available. 
Critical patch updates, which contain security vulnerability fixes, are announced one year in advance on Critical Patch Updates, Security Alerts and Third Party Bulletin. 
This JRE (version 8u144) will expire with the release of the next critical patch update scheduled for October 17, 2017.
Seems to be hardcoded in the installer.
Code:
PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/$FILENAME #must be modified for each release 

https://*.com/questions/43587635/dpkg-error-processing-package-oracle-java8-installer-configure 

其中解决方法未确认,按以下官方解压方法解决安装

apt-get install jdk8 失败