我需要在脚本中安装一个包。这个过程需要重写一些已经存在的配置文件。现在,即使使用DEBIAN_FRONTEND=noninteractive
and运行--force-yes -y
,apt 仍然要求用户输入:
Configuration file `/etc/init.d/nginx'
==> 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.
*** nginx (Y/I/N/O/D/Z) [default=N] ?
如何制作这个完全地不互动?
答案1
你可以尝试yes | program
或者dpkg-reconfigure debconf