Deb 安装要求我提供输入

Deb 安装要求我提供输入

当我尝试在 Ubuntu Jammy(22.04) 中安装“nullmailer”时,它会提示我提供一些必需的输入,例如您的系统的邮件名称:. 有没有什么方法可以避免在安装和配置安装后出现提示?

:/opt# dpkg -i ./nullmailer_2.2-3build1_amd64.deb
Selecting previously unselected package nullmailer.
(Reading database ... 67792 files and directories currently installed.)
Preparing to unpack .../nullmailer_2.2-3build1_amd64.deb ...
Unpacking nullmailer (1:2.2-3build1) ...
Setting up nullmailer (1:2.2-3build1) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.)
debconf: falling back to frontend: Readline
Configuring nullmailer
----------------------

This is the fully-qualified host name of the computer running nullmailer. It defaults to the literal name 'me'.

Mailname of your system:

This is a colon-separated list of remote servers to which to send each message. Each entry contains a remote host name or address followed by an optional protocol string 'host protocol'.
The protocol name defaults to smtp, and may be followed by command-line arguments for that module.

谢谢。

答案1

正如很多帖子中解释的那样,你可以避免提问这样做:

sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install [packagename]

然后,您需要配置软件包。您还可以使用 Ansible 和这些模块来自动执行任务,并以非交互方式应用您的配置并进行安装。

相关内容