linux - 删除损坏的 java 安装 (linux)

标签 linux apt-get

我不知何故弄乱了我的 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/

相关文章:

linux - 你能在 Linux 上运行 Xcode 吗?

linux - Linux Virtual Box 上的恢复

linux - 在 Linux 上构建 Mailcore2

apache - sudo : pecl7. 2-sp:找不到命令

linux - 尝试安装 "screen"时出现 Perl 错误

linux - "-y"标志有什么作用?

linux - 在 VMware vcenter 设备上禁用密码过期?

linux - 编写 Shell 脚本 - 可以打印错误并可以继续保留您刚刚在命令行中运行的输入

apt-get - 如何更新 Fish Terminal 的版本? (乌类图)

python - 运行 apt-get 进出 Anaconda