由于我尝试手动安装 Java,但我无法做到这一点,因此在尝试通过终端或更新管理器安装或更新任何内容时遇到了这些错误。
(Reading database ... 203927 files and directories currently installed.)
Removing jre1.8.0-51 (1.8.051-1) ...
find: `/usr/java/*': No such file or directory
/var/lib/dpkg/info/jre1.8.0-51.postrm: line 586: /usr/sbin/alternatives: No such file or directory
dpkg: error processing package jre1.8.0-51 (--remove):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
jre1.8.0-51
E: Sub-process /usr/bin/dpkg returned an error code (1)
我试过
sudo apt-get autoclean
sudo apt-get install --reinstall dpkg
sudo dpkg -P jre1.8.0-51
它们都不起作用,最后我总是收到那个错误。有人可以帮忙吗?
答案1
刚刚删除了出现错误的文件。
sudo rm /var/lib/dpkg/info/jre1.8.0-51.postrm
这没问题,因为无论如何我都想删除该包。