我最近在 Ubuntu 12.04 beta 上从 webupd8ppa 安装了 oracle jdk,但显然没有起作用,现在每次更新或安装时都会出现错误,即使在从我的源中停用 ppa 之后也是如此。
这是我尝试从 USC 卸载时得到的结果:
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 ... 295120 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-04-12 13:13:21-- http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz
Rsolution de download.oracle.com (download.oracle.com)...
203.13.161.233, 203.13.161.234
Connexion vers download.oracle.com (download.oracle.com)|203.13.161.233|:80... connect. requte HTTP transmise, en attente de la rponse... 302 Moved Temporarily
Emplacement: https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz [suivant]
--2012-04-12 13:13:21-- https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz
Rsolution de edelivery.oracle.com (edelivery.oracle.com)...
173.223.150.174
Connexion vers edelivery.oracle.com (edelivery.oracle.com)|173.223.150.174|:443... connect. requte HTTP transmise, en attente de la rponse... 302 Moved Temporarily Emplacement: http://download.oracle.com/errors/download-fail-1505220.html [suivant]
--2012-04-12 13:13:22-- http://download.oracle.com/errors/download-fail-1505220.html
Connexion vers download.oracle.com (download.oracle.com)|203.13.161.233|:80... connect. requte HTTP transmise, en attente de la rponse... 200 OK
Longueur: 5307 (5,2K) [text/html]
Sauvegarde en : ./jdk-7u3-linux-i586.tar.gz
0K ..... 100% 4,94M=0,001s
2012-04-12 13:13:22 (4,94 MB/s) - ./jdk-7u3-linux-i586.tar.gz sauvegard [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
Error in function:
我也尝试过从突触中“完全删除”,但它也不起作用。
提前谢谢你的帮助!
答案1
我在 Ubuntu 11.10 上遇到了同样的问题,尝试了所有相同的解决方案,但都不起作用。我在另一个讨论板上找到了这个,它似乎对我有用:
如果您想删除 oracle-jdk7-installer,您可以直接转到 /var/lib/dpkg/info/,它需要一些时间来加载,并删除所有以 oracle-java7***** 开头的文件,大约有 6 个文件,然后转到 Synaptic 并找到相同的 oracle-jdk 并单击删除/完全删除。
这是我找到它的地方: http://ubuntuforums.org/showthread.php?p=11821814
祝你好运!
编辑:以下是轻松完成此操作的 3 个步骤:
打开终端(ctrl + alt + T)并依次输入这两个命令:
cd /var/lib/dpkg/info/
sudo rm oracle-java7-installer*
打开 synaptic,搜索“oracle-java7-installer”,将其标记为完全删除,然后单击“应用”。
编辑:对于那些没有安装突触的用户,后您已获得 Oracle 安装程序文件,只需执行以下操作:
sudo apt-get purge oracle-java7-installer
你应该表现得很好。
编辑:也可以在 ubuntu 12.04 LTS 上运行
答案2
再次添加webupd8 ppa
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
打开终端并输入:
sudo apt-get update
sudo apt-get install -f
然后使用 ppa purge 清除 ppa
sudo apt-get install ppa-purge
sudo ppa-purge ppa:webupd8team/java
链接
答案3
尝试
sudo apt-get purge <package>
希望这有效!
答案4
如果你在 Ubuntu 中安装软件包时遇到配置错误,那么每次安装其他软件包时都会收到此错误消息。这非常烦人,有一个命令可以删除这个配置错误的软件包。在终端(应用程序/附件/终端)中运行此命令:
sudo apt-get purge $(dpkg -l|grep ^rc|awk '{ print $2 }')