有谁知道如何解决这一问题?
首先我做的是:
sudo add-apt-repository ppa:webupd8team/java
然后我做了:
sudo apt-get update
进而:
$ sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
oracle-java8-installer is already the newest version.
The following packages were automatically installed and are no longer required:
antlr3 libdb6.0 libdb6.0-java-jni libice-dev
libjakarta-taglibs-standard-java libjnr-netdb-java libjstl1.1-java
liblivetribe-jsr223-java libpthread-stubs0-dev libsm-dev
libstringtemplate-java libx11-dev libx11-doc libxau-dev libxcb1-dev
libxdmcp-dev libxt-dev wine-compholio wine-compholio-amd64
wine-compholio-i386:i386 x11proto-core-dev x11proto-input-dev
x11proto-kb-dev xorg-sgml-doctools xtrans-dev
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
The file is already fully retrieved; nothing to do.
Download done.
Removing outdated cached downloads...
sha256sum mismatch jdk-8u25-linux-x64.tar.gz
Oracle JDK 8 is NOT installed.
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: error processing package oracle-java8-installer (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of oracle-java8-set-default:
oracle-java8-set-default depends on oracle-java8-installer; however:
Package oracle-java8-installer is not configured yet.
dpkg: error processing package oracle-java8-set-default (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
oracle-java8-installer
oracle-java8-set-default
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
以下方法可能会有效,它将删除所有部分:
sudo rm /var/cache/oracle-jdk8-installer/jdk-*
然后使用以下命令完成安装:
sudo apt-get install -f
sudo dpkg --configure -a
答案2
sudo apt-get upgrade
我在使用公司代理时遇到了此错误。为了修复此问题,我编辑/etc/apt/apt.conf
并添加了以下几行:
Acquire::http::Proxy "http://[<proxyUserName>:<proxyPass>@]<proxyUrl>:<proxyPort>"; Acquire::https::Proxy "http://[<proxyUserName>:<proxyPass>@]<proxyUrl>:<proxyPort>";
在哪里
[<proxyUserName>:<proxyPass>@]
是您的可选代理身份验证(如果您不进行身份验证,则不要包含此项)<proxyUserName>
是您的代理用户名<proxyPass>
是你的代理密码<proxyUrl>
是你的代理网址<proxyPort>
你的代理端口是
oracle tarball 是通过 https 下载的,因此如果您使用代理,apt 需要 https 代理才能执行它。
编辑后,保存文件,然后打开一个新终端。sudo apt-get update
并根据需要安装。
答案3
当我的 Ubuntu 系统无法从 Oracle 服务器 (文件jdk-8u111-linux-x64.tar.gz
) 下载文件时,我也遇到了类似的问题。因此,我不得不从 Oracle 网站 (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) 并手动复制到文件夹/var/cache/oracle-jdk8-installer/
。这解决了问题,oracle-java8-installer 能够完成安装。