这是一个很长的虚假传奇来解释我是如何来到这里的,但是我在我的 Ubuntu 机器上安装了错误的 JRE 1.8.0-71,并且--force-remove-reinstreq
无法工作:
# sudo dpkg --remove --force-remove-reinstreq jre1.8.0-71
(Reading database ... 633119 files and directories currently installed.)
Removing jre1.8.0-71 (1.8.071-1) ...
find: `/usr/java/*': No such file or directory
/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 (--remove):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
jre1.8.0-71
帮助?
答案1
答案如下:从 /usr/bin/update-alternatives 到 /usr/sbin/alternatives 建立符号链接,使用 dpkg --purge,然后删除该符号链接:
https://stackoverflow.com/questions/33635075/remove-broken-java-installation-linux