“apt full-upgrade”返回“1 未完全安装或删除”。

“apt full-upgrade”返回“1 未完全安装或删除”。

我尝试通过仅删除文件来卸载两个早期版本的 Java,但现在出现此错误,不知道如何解决。问题/解决方案是什么?

$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree  
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/583 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
$ sudo dpkg -C
The following packages are in a mess due to serious problems during
installation.  They must be reinstalled for them (and any packages
that depend on them) to function properly:
 npm                  package manager for Node.js
The following packages are missing the md5sums control file in the
database, they need to be reinstalled:
 npm                  package manager for Node.js

答案1

首先,进行更新apt以确保最新版本与您的更新列表相符:

sudo apt update

然后,重新安装npm以替换任何丢失的文件:

sudo apt install --reinstall -o Dpkg::Options::="--force-confmiss" npm

通过删除文件来卸载软件包很危险。npm适用于 javascript,而不是 java。如果您需要卸载 java 的帮助,我强烈建议您单独提问,以获取有关如何正确卸载的建议。

Dpkg::Options::="--force-confmiss"选项将替换任何丢失的配置文件。

相关内容