I am trying to install sbt on 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)
2 个解决方案
#1
13
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.
希望他们对你有所帮助。
#2
6
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可以被弃用/存档的Oracle链接硬编码在ppa。Oracle正在将他们的旧版本迁移到存档,而PPA有内部链接到“active”(在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 version change 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
阅读更多关于这个问题的信息。
- https://ubuntuforums.org/showthread.php?t=2374686&p=13699352#post13699352
- https://ubuntuforums.org/showthread.php?t=2374686&p=13699352 post13699352
- https://disqus.com/home/discussion/webupd8/install_oracle_java_8_in_ubuntu_via_ppa_jdk8_web_upd8_ubuntu_linux_blog/newest/
- https://disqus.com/home/discussion/webupd8/install_oracle_java_8_in_ubuntu_via_ppa_jdk8_web_upd8_ubuntu_linux_blog/newest/
- http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
- http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
#1
13
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.
希望他们对你有所帮助。
#2
6
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可以被弃用/存档的Oracle链接硬编码在ppa。Oracle正在将他们的旧版本迁移到存档,而PPA有内部链接到“active”(在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 version change 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
阅读更多关于这个问题的信息。
- https://ubuntuforums.org/showthread.php?t=2374686&p=13699352#post13699352
- https://ubuntuforums.org/showthread.php?t=2374686&p=13699352 post13699352
- https://disqus.com/home/discussion/webupd8/install_oracle_java_8_in_ubuntu_via_ppa_jdk8_web_upd8_ubuntu_linux_blog/newest/
- https://disqus.com/home/discussion/webupd8/install_oracle_java_8_in_ubuntu_via_ppa_jdk8_web_upd8_ubuntu_linux_blog/newest/
- http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
- http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html