安装包时出错

安装包时出错

每当我运行此命令时:sudo apt-get install

$ sudo apt-get install

Reading package lists... Done

Building dependency tree

Reading state information... Done

0 upgraded, 0 newly installed, 0 to remove and 244 not upgraded.

2 not fully installed or removed.

After this operation, 0 B of additional disk space will be used.

Setting up oracle-java7-installer (7u40~trusty~NoobsLab.com) ...

Downloading Oracle Java 7...
--2015-04-28 12:10:32--  http  download.oracle.com/otn-pub/java/jdk/7u40-b43/jdk-7u40-linux-x64.tar.gz

Resolving download.oracle.com (download.oracle.com)... 125.56.222.17, 125.56.222.11

Connecting to download.oracle.com (download.oracle.com)|125.56.222.17|:80... connected.

HTTP request sent, awaiting response... 302 Moved Temporarily

Location: https  edelivery.oracle.com/otn-pub/java/jdk/7u40-b43/jdk-7u40-linux-x64.tar.gz [following]

--2015-04-28 12:10:32--  https://edelivery.oracle.com/otn-pub/java/jdk/7u40-b43/jdk-7u40-linux-x64.tar.gz

Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.57.214.140

Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.57.214.140|:443... connected.

HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [following]

--2015-04-28 12:10:33--  http  download.oracle.com/errors/download-fail-1505220.html

Connecting to download.oracle.com (download.oracle.com)|125.56.222.17|:80... connected.

HTTP request sent, awaiting response... 200 OK


    The file is already fully retrieved; nothing to do.

Download done.

Removing outdated cached downloads...

sha256sum mismatch **jdk-7u40-linux-x64.tar.gz**

Oracle JDK 7 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-java7-installer (--configure):

 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of oracle-java7-set-default:
 oracle-java7-set-default depends on oracle-java7-installer; however:

  Package oracle-java7-installer is not configured yet.

dpkg: error processing package oracle-java7-set-default (--configure):
 dependency problems - leaving unconfigured

Errors were encountered while processing:
 oracle-java7-installer
 oracle-java7-set-default

E: Sub-process /usr/bin/dpkg returned an error code (1)



i remove jdk-7u40-linux-x64.tar.gz from my /var/cache ... but still showing the same error .
Its still shows in /var/cache.

答案1

要修复 Oracle java 7,请尝试以下操作:

sudo dpkg -P oracle-java7-installer
sudo apt-get -f install
sudo apt-get install oracle-java7-installer

如果您确实要安装 java,我建议您安装 openjdk(它是 oracle java 的一个开放的、参考实现,在 linux 上运行得更好)而不是 oracle-java。清除 oracle java 并用于sudo dpkg -P oracle-java7-installer安装sudo apt-get install openjdk-7-jreJRE 或sudo apt-get install openjdk-7-jdk用于安装 JDK。

相关内容