dpkg: 错误处理包 oracle-java8-installer (--configure):
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43587635/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
dpkg: error processing package oracle-java8-installer (--configure):
提问by Galet
I am trying to install sbton Ubuntu 16.04. I have mistakenly stopped the process when running the following command,
我正在尝试在 Ubuntu 16.04 上安装sbt。运行以下命令时,我错误地停止了该进程,
sudo apt-get install sbt
Now when I try to install again, I am getting the below error,
现在,当我再次尝试安装时,出现以下错误,
Downloading Oracle Java 8...
--2017-04-24 17:34:33-- http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 104.80.89.58, 104.80.89.16
Connecting to download.oracle.com (download.oracle.com)|104.80.89.58|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz [following]
--2017-04-24 17:34:35-- https://edelivery.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.200.209.153, 2600:1409:a:183::2d3e, 2600:1409:a:193::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.200.209.153|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz?AuthParam=1493035597_d0396e6a99df9ccfeb3f6d895673df09 [following]
--2017-04-24 17:34:37-- http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz?AuthParam=1493035597_d0396e6a99df9ccfeb3f6d895673df09
Connecting to download.oracle.com (download.oracle.com)|104.80.89.58|:80... connected.
HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable
The file is already fully retrieved; nothing to do.
Download done.
Removing outdated cached downloads...
sha256sum mismatch jdk-8u131-linux-x64.tar.gz
Oracle JDK 8 is NOT installed.
dpkg: error processing package oracle-java8-installer (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of sbt:
sbt depends on openjdk-8-jdk; however:
Package openjdk-8-jdk is not installed.
Package oracle-java8-installer which provides openjdk-8-jdk is not configured yet.
dpkg: error processing package sbt (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
oracle-java8-installer
sbt
E: Sub-process /usr/bin/dpkg returned an error code (1)
How do I solve this?
我该如何解决这个问题?
Update 1:
更新 1:
I have tried this solution. But still it didn't help me to solve this issue and getting the same error below?
我已经尝试过这个解决方案。但它仍然没有帮助我解决这个问题并在下面得到相同的错误?
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up oracle-java8-installer (8u131-1~webupd8~2) ...
Installing from local file /var/cache/oracle-jdk8-installer/jdk-8u131-linux-x64.tar.gz
Removing outdated cached downloads...
install: cannot stat 'javaws-wrapper.sh': No such file or directory
dpkg: error processing package oracle-java8-installer (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of sbt:
sbt depends on openjdk-8-jdk; however:
Package openjdk-8-jdk is not installed.
Package oracle-java8-installer which provides openjdk-8-jdk is not configured yet.
dpkg: error processing package sbt (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
oracle-java8-installer
sbt
E: Sub-process /usr/bin/dpkg returned an error code (1)
回答by code4f
it's so long time since you asked. Because of no answer here, I show you my solution that works well for me.
你问了这么久了。由于这里没有答案,我向您展示了我的解决方案,它对我很有效。
The root cause of your problem may be from previous java install (it's not from any repositories, but from manually download package). Thus, you must manually remove post-install scripts, use below commands:
问题的根本原因可能来自之前的 java 安装(它不是来自任何存储库,而是来自手动下载包)。因此,您必须手动删除安装后脚本,使用以下命令:
sudo rm /var/lib/dpkg/info/oracle-java8-installer.postinst -f
sudo dpkg --configure oracle-java8-installer
Hope them help you.
希望他们能帮助你。
回答by hrvoj3e
!! NOTE !!This solution may not work if Oracle stops serving files from their FTP service. They do that for older Java releases.
!! 笔记 !!如果 Oracle 停止从其 FTP 服务提供文件,则此解决方案可能不起作用。他们为较旧的 Java 版本执行此操作。
When using ppa:webupd8team/java
there can be deprecated/archived Oracle links hardcoded in PPA.
Oracle is moving their older versions to archive and PPA has internal links to "active" (at the time of PPA creation) Oracle download versions.
使用时ppa:webupd8team/java
,可能会在 PPA 中硬编码已弃用/存档的 Oracle 链接。Oracle 正在将其旧版本移至存档,并且 PPA 具有指向“活动”(在 PPA 创建时)Oracle 下载版本的内部链接。
The maintainer of ppa:webupd8team/java
is only one man - Andrew (see here)
的维护者ppa:webupd8team/java
只有一个人 - Andrew(见这里)
Problem
问题
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)
Solution
解决方案
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.*
Java versions change "often" so update
8u151
and8u162
to reflect your environment. (this versions worked on Ubuntu 16.04.3 LTS - 2018-01-18)
Java 版本“经常”更改,因此请更新
8u151
并8u162
反映您的环境。(此版本适用于 Ubuntu 16.04.3 LTS - 2018-01-18)
Try again
再试一次
apt install oracle-java8-installer
apt install oracle-java8-set-default
Read more about the problem
阅读有关问题的更多信息
回答by Juan Jose Mu?oz
Solution with 16.0.4:
16.0.4 的解决方案:
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 CharithaMadu
The following worked in Ubuntu 18.10
以下在 Ubuntu 18.10 中有效
cd /var/lib/dpkg/info
sed -i 's|JAVA_VERSION=8u191|JAVA_VERSION=8u201|' oracle-java8-installer.*
sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/|' oracle-java8-installer.*
sed -i 's|SHA256SUM_TGZ="53c29507e2405a7ffdbba627e6d64856089b094867479edc5ede4105c1da0d65"|SHA256SUM_TGZ="cb700cc0ac3ddc728a567c350881ce7e25118eaf7ca97ca9705d4580c506e370"|' oracle-java8-installer.*
sed -i 's|J_DIR=jdk1.8.0_191|J_DIR=jdk1.8.0_201|' oracle-java8-installer.*
回答by Oguzhan BOLUKBAS
For Ubuntu 19.04 and Oracle JDK 11:
对于 Ubuntu 19.04 和 Oracle JDK 11:
sudo rm /var/lib/dpkg/info/oracle-java11-installer-local.postinst -f
sudo dpkg --configure oracle-java11-installer-local