我不知何故弄乱了我的 Java 安装,现在我明白了:
$ sudo apt-get remove jre1.8.0_66
(Reading database ... 55212 files and directories currently installed.)
Removing jre1.8.0-65 ...
find: `/usr/java/*': No such file or directory
/var/lib/dpkg/info/jre1.8.0-65.postrm: line 586: /usr/sbin/alternatives: No such file or directory
dpkg: error processing jre1.8.0-65 (--remove):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
jre1.8.0-65
E: Sub-process /usr/bin/dpkg returned an error code (1)
我怎样才能强制删除它?包含 java 文件的文件夹是空的,但每次我安装某些东西时都会显示...
编辑:Linux 说它已安装/删除了一半:
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
最佳答案
/usr/sbin/alternatives: No such file or directory
在 Debian、Ubuntu 或它们的克隆中没有 /usr/sbin/alternatives
。
相反,有 /usr/bin/update-alternatives
。
我建议使用临时符号链接(symbolic link)来解决转换错误的 RPM 包:
mkdir -p /usr/sbin
ln -s /usr/bin/update-alternatives /usr/sbin/alternatives
关于linux - 删除损坏的 java 安装 (linux),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33635075/