Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My system configuration script does an "apt-get install -y postfix". Unfortunately the script is halted when the postfix installer displays a configuration screen. Is there a method to force postfix to use the defaults during installation so that an automated script can continue to the end?

Does the postfix installer maybe check for existing configuration in /etc/postfix, and if it exists, not bother the user with the configuration screen?

share|improve this question

2 Answers 2

up vote 19 down vote accepted

You can use pre-seeding for this, using the debconf-set-selections command to pre-answer the questions asked by debconf before installing the package.

For example:

debconf-set-selections <<< "postfix postfix/mailname string your.hostname.com"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"
apt-get install -y postfix
share|improve this answer
2  
Specifically: debconf-set-selections <<< "postfix postfix/mailname string your.hostname.com" and debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'" –  Demelziraptor Jan 14 '13 at 9:57

If you want this globally:

dpkg-reconfigure debconf

Then configure it to be "noninteractive"

If you just want it for single install run:

DEBIAN_FRONTEND=noninteractive apt-get install PACKAGE
share|improve this answer
    
You could also do export DEBIAN_FRONTEND=noninteractive to set it globally in an unattended fashion. –  Mahn Sep 5 at 13:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.