我通过从java.com (1.8.0-71)
下载RPM文件来安装java,并使用alien生成我安装的 .deb 文件。它失败了,我不能再把它删除了。
如果我尝试使用apt-get,我总会得到一个说明,我应该重新安装包(如果那么简单):
LC_ALL=C sudo dpkg --purge --force-all jre1.8.0-71
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
(Reading database ... 84902 files and directories currently installed.)
Removing jre1.8.0-71 (1.8.071-1) ...
/var/lib/dpkg/info/jre1.8.0-71.postrm: line 586: /usr/sbin/alternatives: No such file or directory
dpkg: error processing package jre1.8.0-71 (--purge):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
jre1.8.0-71
当我尝试强制清除时:
faustdonner@v22015113109829193:~$ sudo dpkg --force-all --purge jre1.8.0-71
dpkg: Warnung: Problem wird übergangen, weil --force angegeben ist:
dpkg: Warnung: Paket ist in einem sehr schlechten inkonsistenten Zustand - Sie sollten
es erneut installieren, bevor Sie es zu entfernen versuchen.
(Lese Datenbank ... 84902 Dateien und Verzeichnisse sind derzeit installiert.)
Entfernen von jre1.8.0-71 (1.8.071-1) ...
/var/lib/dpkg/info/jre1.8.0-71.postrm: Zeile 586: /usr/sbin/alternatives: Datei oder Verzeichnis nicht gefunden
dpkg: Fehler beim Bearbeiten des Paketes jre1.8.0-71 (--purge):
Unterprozess installiertes post-removal-Skript gab den Fehlerwert 127 zurück
Fehler traten auf beim Bearbeiten von:
jre1.8.0-71
包的状态:
faustdonner@v22015113109829193:~/iRedMail-0.9.4$ dpkg -s jre1.8.0-71
Package: jre1.8.0-71
Status: purge reinstreq half-installed
Priority: extra
Section: alien
Installed-Size: 122630
Maintainer: faustdonner <faustdonner@v22015113109829193>
Architecture: amd64
Version: 1.8.071-1
Config-Version: 1.8.071-1
Conffiles:
/usr/java/jre1.8.0_71/.java/.systemPrefs/.system.lock d41d8cd98f00b204e9800998ecf8427e
/usr/java/jre1.8.0_71/.java/.systemPrefs/.systemRootModFile d41d8cd98f00b204e9800998ecf8427e
/usr/java/jre1.8.0_71/.java/init.d/jexec 3a4104cd0a34b5e7e55433a78d9f7721
/usr/java/jre1.8.0_71/lib/charsets.pack 05951e01ac743c82b30fd29269bda4cf
/usr/java/jre1.8.0_71/lib/deploy.pack 5b3940dd00902468af3c38f7af733fe2
/usr/java/jre1.8.0_71/lib/ext/jfxrt.pack 025c9f48e8accc9651338cc48a1e93b0
/usr/java/jre1.8.0_71/lib/ext/localedata.pack 311294753566ba95d9cd78ee9d427feb
/usr/java/jre1.8.0_71/lib/javaws.pack 1d6ea5448180750737c6fe71221f89b8
/usr/java/jre1.8.0_71/lib/jsse.pack 50a27dfb6b47ca44f904a6597e376f30
/usr/java/jre1.8.0_71/lib/plugin.pack 059b296ac6faa78cbe6b7148161c55b3
/usr/java/jre1.8.0_71/lib/rt.pack 83ea5f918d52994d3494f628438eba2e
Description: Java Platform Standard Edition Runtime Environment
The Java Platform Standard Edition Runtime Environment (JRE) contains
everything necessary to run applets and applications designed for the
Java platform. This includes the Java virtual machine, plus the Java
platform classes and supporting files.
.
The JRE is freely redistributable, per the terms of the included license.
.
(Converted from a rpm package by alien version 8.90.)
第二行说它处于非常不稳定的状态。它试图访问它尚未创建的文件夹,因此它在我尝试的所有内容中都失败了。我可以在dpkg中删除安装条目,这样就好像我从未安装过它吗?我不在乎它是否超级干净,我只是想再次使用apt-get。
找到强行删除包裹的答案:
http://www.piprime.fr/1480/manually-remove-broken-package-debian-ubuntu/
答案 0 :(得分:1)
你不应该像那样安装Java。
首先,从这里抓取 tar.gz :http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
然后执行以下步骤:
sudo apt-get purge openjdk-\*
sudo mkdir -p /usr/local/java
cd Downloads/
sudo mv jdk-8u72-linux-x64.tar.gz /usr/local/java/
cd /usr/local/java/
sudo tar xvzf jdk-8u72-linux-x64.tar.gz
sudo rm jdk-8u72-linux-x64.tar.gz
然后打开您的个人资料,并在结尾复制以下行:
sudo gedit / etc / profile
JAVA_HOME=/usr/local/java/jdk1.8.0_72
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export PATH
最后执行以下步骤:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_72/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_72/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_72/bin/javaws" 1
sudo update-alternatives --set java /usr/local/java/jdk1.8.0_72/bin/java
sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_72/bin/javac
sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_72/bin/javaws
请注意,“ cd Downloads / ”部分可能会因您的情况而有所不同,而且,您可以将它放在任何您想要的位置,而不仅仅是 / usr / local / java / - 只确保你在任何地方使用相同的路径。
答案 1 :(得分:0)
我现在解决了这个问题。这个网站解释得非常好:
http://www.piprime.fr/1480/manually-remove-broken-package-debian-ubuntu/
我认为这不是最好的方法,但它是破坏包裹的最后可能性。