Установка программы во всю программу установки по умолчанию (без какого-либо запроса)? [dубликат]

Если я запустил:

sudo apt-get --yes install postfix

или

sudo bash -c 'yes | apt-get --yes install postfix'

появляется диалоговое приглашение для настройки постфикса. Мне нужно автоматизировать установку постфикса (я могу изменить файлы конфигурации после установки).

Есть ли какая-то магия, которая позволяет мне устанавливать постфикс (и другой пакет) без вмешательства человека?

17
задан 4 December 2014 в 04:43

2 ответа

Установите DEBIAN_FRONTEND на noninteractive:

DEBIAN_FRONTEND=noninteractive apt-get ...

Это также применимо к dpkg --reconfigure, dpkg-configure и т. д.

Из DEBIAN_FRONTEND :

noninteractive This is the anti-frontend. It never interacts with you at all, and makes the default answers be used for all questions. It might mail error messages to root, but that's it; otherwise it is completely silent and unobtrusive, a perfect frontend for automatic installs. If you are using this front-end, and require non-default answers to questions, you will need to preseed the debconf database; see the section below on Unattended Package Installation for more details.

Если вы установите noninteractive, вы должны ответить на вопросы debconf, используя debconf-set-selections.

25
ответ дан 17 July 2018 в 22:33

Установите DEBIAN_FRONTEND на noninteractive:

DEBIAN_FRONTEND=noninteractive apt-get ...

Это также применимо к dpkg --reconfigure, dpkg-configure и т. д.

Из DEBIAN_FRONTEND :

noninteractive This is the anti-frontend. It never interacts with you at all, and makes the default answers be used for all questions. It might mail error messages to root, but that's it; otherwise it is completely silent and unobtrusive, a perfect frontend for automatic installs. If you are using this front-end, and require non-default answers to questions, you will need to preseed the debconf database; see the section below on Unattended Package Installation for more details.

Если вы установите noninteractive, вы должны ответить на вопросы debconf, используя debconf-set-selections.

25
ответ дан 23 July 2018 в 23:11

Другие вопросы по тегам:

Похожие вопросы: