ubuntu通过ppa源安装jdk时遇到如下问题:
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)
问题原因:
版本不匹配
解决办法:
执行以下命令
cd /var/lib/dpkg/info sudo sed -i ‘s|JAVA_VERSION=8u151|JAVA_VERSION=8u162|‘ oracle-java8-installer.* sudo sed -i ‘s|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/|‘ oracle-java8-installer.* sudo sed -i ‘s|SHA256SUM_TGZ="c78200ce409367b296ec39be4427f020e2c585470c4eed01021feada576f027f"|SHA256SUM_TGZ="68ec82d47fd9c2b8eb84225b6db398a72008285fafc98631b1ff8d2229680257"|‘ oracle-java8-installer.* sudo sed -i ‘s|J_DIR=jdk1.8.0_151|J_DIR=jdk1.8.0_162|‘ oracle-java8-installer.*
再重新安装
sudo apt install oracle-java8-installer sudo apt install oracle-java8-set-default
参考: