我正在远程服务器上安装软件包,使用ssh:
ssh root@my-host "DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get --quiet --yes install w3m"即使我设置了DEBIAN_FRONTEND=noninteractive,安装仍然停留在以下问题上,我必须手动按enter:
Configuration file '/etc/w3m/config'
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** config (Y/I/N/O/D/Z) [default=N] ? 我怀疑,这个问题是由dpkg --configure -a而不是apt-get提出的,因此非交互性被忽略了。
发布于 2018-01-13 13:41:37
这种配置文件更改冲突由dpkg处理,您可以强制它使用--force-confdef选项选择默认选项。不过,一定要注意文献资料发出的警告:
警告:这些选项大多仅供专家使用。在不完全理解它们的影响的情况下使用它们,可能会破坏整个系统。
要在APT调用dpkg时提供此选项,需要将其添加到APT设置中,例如向/etc/apt/apt.conf添加以下行:
DPkg::options { "--force-confdef"; };或者,对于一次调用:
apt-get -o DPkg::Options::=--force-confdef ...DEBIAN_FRONTEND=noninteractive只影响debconf,在这个场景中根本没有涉及到这一点。
https://unix.stackexchange.com/questions/416815
复制相似问题