![“存在问题并且使用了 -y 而没有使用 --force-yes”是什么意思?](https://linux22.com/image/894409/%E2%80%9C%E5%AD%98%E5%9C%A8%E9%97%AE%E9%A2%98%E5%B9%B6%E4%B8%94%E4%BD%BF%E7%94%A8%E4%BA%86%20-y%20%E8%80%8C%E6%B2%A1%E6%9C%89%E4%BD%BF%E7%94%A8%20--force-yes%E2%80%9D%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D%EF%BC%9F.png)
我正在让 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
。
如果您使用的是apt
1.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.