如何删除安装新软件时出现的错误信息

如何删除安装新软件时出现的错误信息

首先,我通过终端安装了 oracle java。它出现错误。我不记得错误消息了。但其他 java 应用程序正在运行,例如 netbeans、eclipse。主要问题是当我通过终端或 ubuntu 软件中心安装任何新软件时,首先出现此错误。

sha256sum mismatch jdk-7u3-linux-i586.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。我使用的是 Ubuntu 12.04

编辑 当我尝试删除 Sun Java(TM) Development Kit (JDK) 7 时收到此错误消息。

installArchives() failed: (Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 189962 files and directories currently installed.)
Removing oracle-java7-installer ...
update-alternatives: error: unknown argument `cdrom'
dpkg: error processing oracle-java7-installer (--remove):
 subprocess installed pre-removal script returned error exit status 2
No apport report written because MaxReports is reached already
Downloading...
--2012-05-21 22:54:41--  http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz
Resolving download.oracle.com (download.oracle.com)... 222.165.168.249, 222.165.168.202
Connecting to download.oracle.com (download.oracle.com)|222.165.168.249|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz [following]
--2012-05-21 22:54:42--  https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 173.222.122.174
Connecting to edelivery.oracle.com (edelivery.oracle.com)|173.222.122.174|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [following]
--2012-05-21 22:54:43--  http://download.oracle.com/errors/download-fail-1505220.html
Connecting to download.oracle.com (download.oracle.com)|222.165.168.249|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: `./jdk-7u3-linux-i586.tar.gz'

     0K .....                                                 100%  152K=0.03s

2012-05-21 22:54:43 (152 KB/s) - `./jdk-7u3-linux-i586.tar.gz' saved [5307/5307]

Download done.
sha256sum mismatch jdk-7u3-linux-i586.tar.gz
Oracle JDK 7 is NOT installed.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 oracle-java7-installer

答案1

运行这些命令应该可以解决你的问题:

sudo apt-get update
sudo apt-get --purge reinstall oracle-java7-installer
sudo apt-get upgrade

如果没有,那么请编辑您的问题以包含您运行它们时终端中的所有文本(因为输出仍然具有诊断用途)。

答案2

其实修复方法很简单。请先在 Ubuntu 软件中心安装 Synaptic 包管理器。安装后,您需要使用 root 权限打开它:

sudo synaptic

搜索 Oracle-java7-installer,右键单击它,然后将其完全删除。应用更改,删除 PPA,您的错误消息将消失。在此处输入图片描述

答案3

Synaptic 包管理器在删除有依赖性问题的文件时非常有用,特别是在sudo apt-get install -f不起作用的时候。

相关内容