Если я работаю:
sudo apt-get --yes install postfix
или
sudo bash -c 'yes | apt-get --yes install postfix'
интерактивная подсказка, кажется, настраивает постфикс. Я должен автоматизировать установку постфикса (я могу изменить конфигурационные файлы после установки).
Разве существует ли некоторое волшебство, которое позволяет мне установить постфикс (и другой пакет) без человеческого вмешательства?
Установите DEBIAN_FRONTEND
кому: noninteractive
:
DEBIAN_FRONTEND=noninteractive apt-get ...
Это также применимо к dpkg --reconfigure
, dpkg-configure
, и т.д.
От man 7 debconf
:
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
.