resolvconf 已卸载,无法再次安装

resolvconf 已卸载,无法再次安装

所以当我这样做时:

sudo apt-get install *Package*

它说:

dpkg: too many errors, stopping
Errors were encountered while processing:
 resolvconf
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

当我尝试查看问题出在哪里时我输入:

sudo resolvconf

它说:

Command 'resolvconf' not found, but can be installed with:

sudo apt install openresolv  # version 3.10.0-1, or
sudo apt install resolvconf  # version 1.82

然后当我尝试使用以下命令安装它时:

sudo apt-get install resolvconf

它给出了与之前相同的 apt-get 错误。我尝试安装 deb 包,但它显示:

Unable to install resolvconf:
Error while installing package: new resolvconf package post-
removal script subprocess returned error exit status 1

我该怎么做才能解决这个问题。我可以提供您需要的任何额外信息。我正在使用 Ubuntu 20.04 lts。

答案1

在尝试新命令之前,您需要修复先前命令中的错误。

第一个也是最简单的是

sudo apt -f install

或者其他 --fix-broken 选项?它是在没有软件包的情况下发布的,因此它可以纠正现有问题,而不是使问题复杂化。

[man apt-get]1

   -f, --fix-broken
       Fix; attempt to correct a system with broken dependencies in place. This option, when
       used with install/remove, can omit any packages to permit APT to deduce a likely
       solution. If packages are specified, these have to completely correct the problem. The
       option is sometimes necessary when running APT for the first time; APT itself does not
       allow broken package dependencies to exist on a system. It is possible that a system's
       dependency structure can be so corrupt as to require manual intervention (which
       usually means using dpkg --remove to eliminate some of the offending packages). Use of
       this option together with -m may produce an error in some situations. Configuration
       Item: APT::Get::Fix-Broken.

相关内容