安装 jre1.8.0.72 时出错。我该如何删除它?清除时出现错误:
sudo apt-get purge jre1.8.0-72
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
jre1.8.0-72
0 to upgrade, 0 to newly install, 1 to remove and 26 not to upgrade.
1 not fully installed or removed.
After this operation, 126 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 454719 files and directories currently installed.)
Removing jre1.8.0-72 ...
/var/lib/dpkg/info/jre1.8.0-72.postrm: line 586: /usr/sbin/alternatives: No such file or directory
dpkg: error processing jre1.8.0-72 (--remove):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
jre1.8.0-72
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
如果您使用以下方式安装 JavaWebupd8脚本,然后要卸载 Java,请执行以下操作:
sudo apt-get remove --purge oracle-java8-installer
如果您从 Ubuntu 存储库安装了 Java,则可以通过键入以下命令将其删除:
sudo apt-get remove --purge openjdk-*
答案2
要卸载现有的 Java,可以执行以下命令:
sudo apt-get remove openjdk-8-jre
sudo apt-get remove openjdk-8-jre-lib
要再次安装 Java V8,
sudo apt-get install openjdk-8-jdk
答案3
/usr/sbin/alternatives: No such file or directory
可以通过创建一个空文件来解决此错误。