9

While installing mailutils on ubuntu 12.04 using apt-get, there are 2 instances when manual intervention is required, first to select the site configuration and secondly to enter the hostname of the box. Is there a way to automate the installation? I need to install the package on many servers and being a n00b sys admin, I haven't been able to find a solution yet. I can make and install from source, however it has other problems. Thanx.

Premal Shah
  • 181
  • 4
  • 13
  • Possible duplicate of [How can I automate dpkg/apt-get?](http://stackoverflow.com/questions/702248/how-can-i-automate-dpkg-apt-get) – tripleee Jan 21 '16 at 17:19

2 Answers2

12

You can use debconf-set-selections to pre-select answers :

$ 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 mailutils
Sysless
  • 166
  • 1
  • 6
1

You'll likely want to look into debconf configuration specifics. Here's a link that should help.

Mark Stanislav
  • 979
  • 4
  • 11