“存在问题并且使用了 -y 而没有使用 --force-yes”是什么意思?

“存在问题并且使用了 -y 而没有使用 --force-yes”是什么意思?

我正在让 Puppet 自动生成并运行这个命令:

sudo /usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install 2klic-gateway=2.10.5

运行时返回:

There are problems and -y was used without --force-yes

我正在尝试理解此错误消息。软件包提供商的 GPG 密钥有效,手动运行不带标志的命令没有问题-y

为什么 Ubuntu 强迫我使用--force-yes(这可能很危险)或手动输入y,而不使用-y标志?

答案1

我发现任何时候软件包降级都必须手动或使用 来完成--force-yes。这是软件包制造商的意图apt

如果您使用的是apt1.1 版本,那么您也可以使用--allow-downgrades。1.1 之前的版本--force-yes是唯一的选择。

Apt版本 1.1 还添加了--allow-remove-essential--allow-change-held-packages,这对于偶然发现这个问题的任何人来说可能都很有用。

来自手册页:http://manpages.ubuntu.com/manpages/zesty/man8/apt-get.8.html

   --allow-downgrades
       This is a dangerous option that will cause apt to continue without
       prompting if it is doing downgrades. It should not be used except
       in very special situations. Using it can potentially destroy your
       system! Configuration Item: APT::Get::allow-downgrades. Introduced
       in APT 1.1.

   --allow-remove-essential
       Force yes; this is a dangerous option that will cause apt to
       continue without prompting if it is removing essentials. It should
       not be used except in very special situations. Using it can
       potentially destroy your system! Configuration Item:
       APT::Get::allow-remove-essential. Introduced in APT 1.1.

   --allow-change-held-packages
       Force yes; this is a dangerous option that will cause apt to
       continue without prompting if it is changing held packages. It
       should not be used except in very special situations. Using it can
       potentially destroy your system! Configuration Item:
       APT::Get::allow-change-held-packages. Introduced in APT 1.1.

   --force-yes
       Force yes; this is a dangerous option that will cause apt to
       continue without prompting if it is doing something potentially
       harmful. It should not be used except in very special situations.
       Using force-yes can potentially destroy your system! Configuration
       Item: APT::Get::force-yes. This is deprecated and replaced by
       --allow-downgrades, --allow-remove-essential,
       --allow-change-held-packages in 1.1.

相关内容