我花了大部分时间在我的crunchbang发行版上安装java 7。我最初安装了OpenJDK,但在安装时遇到了问题。现在(以某种方式)排序了,但是现在我没有java 7或OpenJDK。我的java版本是:
matt@crunchbang:~$ java -version
java version "1.5.0"
gij (GNU libgcj) version 4.7.2
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.当试图安装java 7(sudo apt-get install Oracle-java7-installer)时,我最终会出现如下所示的错误:
sha256sum mismatch jdk-7u7-linux-x64.tar.gz
Oracle JDK 7 is NOT installed.
dpkg: error processing oracle-java7-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java7-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)我尝试过的事情:
完整的java安装日志:
matt@crunchbang:~$ sudo apt-get install oracle-java7-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
fonts-opensymbol fonts-sil-gentium fonts-sil-gentium-basic gcj-4.7-base gcj-4.7-jre gcj-4.7-jre-headless gcj-4.7-jre-lib gcj-jre
gcj-jre-headless libapache-pom-java libcmis-0.2-0 libcommons-beanutils-java libcommons-collections3-java libcommons-compress-java
libcommons-digester-java libcommons-logging-java libcommons-parent-java libdb-java libdb-je-java libdb5.1-java libdb5.1-java-jni
libexttextcat-data libexttextcat0 libgcj-common libgcj13 libgcj13-awt libgraphite2-2.0.0 libhsqldb-java libhyphen0 libicu4j-java
libjaxp1.3-java libjline-java libjtidy-java liblucene2-java libmythes-1.2-0 libneon27-gnutls libnss3-1d libregexp-java libservlet2.5-java
libvisio-0.0-0 libxalan2-java libxerces2-java libxml-commons-external-java libxml-commons-resolver1.1-java libxz-java
ttf-sil-gentium-basic uno-libs3 ure xfonts-mathml
Use 'apt-get autoremove' to remove them.
Suggested packages:
binfmt-support visualvm ttf-baekmuk ttf-unfonts ttf-unfonts-core ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho
ttf-sazanami-mincho ttf-arphic-uming
The following NEW packages will be installed:
oracle-java7-installer
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/16.2 kB of archives.
After this operation, 88.1 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package oracle-java7-installer.
(Reading database ... 94766 files and directories currently installed.)
Unpacking oracle-java7-installer (from .../oracle-java7-installer_7u7-0~crunchbang~4_all.deb) ...
Processing triggers for desktop-file-utils ...
Setting up oracle-java7-installer (7u7-0~crunchbang~4) ...
Removing outdated cached downloads...
Downloading Oracle Java 7...
--2014-05-23 15:35:08-- http://download.oracle.com/otn-pub/java/jdk/7u7-b10/jdk-7u7-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 23.73.181.33, 23.73.181.26
Connecting to download.oracle.com (download.oracle.com)|23.73.181.33|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u7-b10/jdk-7u7-linux-x64.tar.gz [following]
--2014-05-23 15:35:08-- https://edelivery.oracle.com/otn-pub/java/jdk/7u7-b10/jdk-7u7-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.78.166.140
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.78.166.140|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [following]
--2014-05-23 15:35:09-- http://download.oracle.com/errors/download-fail-1505220.html
Connecting to download.oracle.com (download.oracle.com)|23.73.181.33|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: `jdk-7u7-linux-x64.tar.gz'
0K 100% 3.48M=0.001s
2014-05-23 15:35:09 (3.48 MB/s) - `jdk-7u7-linux-x64.tar.gz' saved [5307/5307]
Download done.
sha256sum mismatch jdk-7u7-linux-x64.tar.gz
Oracle JDK 7 is NOT installed.
dpkg: error processing oracle-java7-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java7-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)发布于 2014-08-17 15:58:44
我正在我的chromebook上运行crunchbang喘息,并且遇到了完全相同的问题。
这帮我修好了:
我也遇到了类似的问题,我发现对我起作用的是进入/var/lib/dpkg/info,删除所有具有这个名称的内容,您可能还必须进入/var/cache/apt/ found并做同样的事情。我对linux相当陌生,所以如果这破坏了什么,我很抱歉。我还没有遇到这引起的任何问题。
警告:
您正在删除预安装脚本和安装后脚本。这很容易就意味着软件包将无法正确安装,而且如果您选择卸载它,它也不会被正确地移除。这样做是不对的。
然而,我找不到任何其他的解决办法。当然,我当时急于解决这个问题,所以我并没有花太多的时间去寻找另一种解决方案。
(解决方案和引用摘自:http://www.linuxquestions.org/questions/debian-26/sub-process-usr-bin-dpkg-returned-an-error-code-1-a-171107/)
https://stackoverflow.com/questions/23837493
复制相似问题