如何删除一半安装的软件包?(Sun JDK-Java)


9

我尝试从安装Sun JDK sudo add-apt-repository ppa:eugenesan/java,但由于以下原因而失败:

Downloading...
--2012-05-05 15:50:09--  http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 80.239.230.162
Connecting to download.oracle.com (download.oracle.com)|80.239.230.162|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz [following]
--2012-05-05 15:50:09--  https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 2.17.254.174
Connecting to edelivery.oracle.com (edelivery.oracle.com)|2.17.254.174|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [following]
--2012-05-05 15:50:09--  http://download.oracle.com/errors/download-fail-1505220.html
Connecting to download.oracle.com (download.oracle.com)|80.239.230.162|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: `./jdk-7u3-linux-x64.tar.gz'

     0K .....                                                 100% 20.5M=0s

2012-05-05 15:50:09 (20.5 MB/s) - `./jdk-7u3-linux-x64.tar.gz' saved [5307/5307]

Download done.
sha256sum mismatch jdk-7u3-linux-x64.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

因此,显然它正在尝试获取错误的URL。我已经手动安装了Java,但是现在该软件包卡在了一半位置,每次我执行apt-get install任何操作时,都会再次出现该错误。

apt-get install -f显示“ 1未完全安装或卸下。” 包并失败,并出现相同的错误。我已经尝试过dpkg -P oracle-java7-installer,但是也失败了。

如何删除这个半安装的软件包?


Answers:


10

Awww yeahh .. 通过以下方法找到这篇文章后sudo find /var/lib/dpkg -exec grep -l "oracle-java7-installer" {} \;,我终于能够删除:显示了一堆文件,我已经exit 0通过键入sudo gedit /var/lib/dpkg/info/oracle-java7-installer.prerm,保存的文件和关闭的gedit 将其添加到第一行。最终,在我回到命令行后,键入sudo dpkg -P oracle-java7-installer并成功了。


顺便说一句,如果您要修复半安装的软件包,而不是手动安装Java,则此处的答案应该可以简化这一过程。
伊利亚·卡根

工作正常!就我而言,我必须编辑/var/lib/dpkg/info/oracle-java8-installer.postinst并在其中添加出口0。
user334639


0

使用“ Synaptic软件包管理器”删除或修复损坏的软件包

要下载并安装“ Synaptic软件包管理器”,请在终端中键入以下命令>>

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install synaptic

不起作用。将软件包标记为要删除,然后单击“应用”-该软件包仍然存在。我猜测它会遇到相同的错误
蓬松的
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.