在 Ubuntu 16.04 上使用 apt-get install 安装某些东西时出错

在 Ubuntu 16.04 上使用 apt-get install 安装某些东西时出错

我正在尝试安装 xpad、Wine 但出现同样的错误。

sudo apt-get install xpad

错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: The package jdk1.8.0-101 needs to be reinstalled, but I can't find an archive for it.

如何修复它,谢谢。

[更新] 我尝试删除 jdk1.8.0_101

sudo dpkg --remove --force-remove-reinstreq  jdk1.8.0-101

dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
(Reading database ... 221715 files and directories currently installed.)
Removing jdk1.8.0-101 (1.8.0101-1) ...
find: ‘/usr/java/*’: No such file or directory
/var/lib/dpkg/info/jdk1.8.0-101.postrm: line 586: /usr/sbin/alternatives: No such file or directory
/var/lib/dpkg/info/jdk1.8.0-101.postrm: line 598: /usr/sbin/alternatives: No such file or directory
dpkg: error processing package jdk1.8.0-101 (--remove):
 subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
 jdk1.8.0-101

我认为我缺少这些文件夹,因为我自己手动将其删除了。

答案1

看起来您的包处于不一致的状态,这会阻止您安装任何东西。

您可以尝试以下答案这个问题,将linux-headers-3.0.0-19替换为jdk1.8.0-101,看看是否有帮助。

之后最好重新正确安装该软件包(很可能有些事情取决于它......)

相关内容