error processing package oracle-java8-installer问题解决

Posted verygoodverygood

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了error processing package oracle-java8-installer问题解决相关的知识,希望对你有一定的参考价值。

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

 

参考:

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

见第二个回答,由用户hrvoj3e发布








以上是关于error processing package oracle-java8-installer问题解决的主要内容,如果未能解决你的问题,请参考以下文章

dpkg: error processing package bluez (--configure) 解决方法

error processing package oracle-java8-installer问题解决

解决pip install package时Fatal error in launcher: Unable to create process using '"e:python36(

error: cannot open Packages database in /var/lib/rpm

error: cannot open Packages database in /var/lib/rpm

Linux - error: cannot open Packages database in /var/lib/rpm