Quantcast
Channel: Howtos & more …– LANbugs
Viewing all articles
Browse latest Browse all 144

Unattended Installation von APT Paketen (Debian/Ubuntu)

$
0
0

Um Pakete ohne manuelle Eingaben zu Installieren müssen die Antworten für die Assistenten bereits vorliegen.

Als Beispiel eine unattended Installation von Postfix auf einem Ubuntu 16.04 LTS System.

Um die möglichen Parameter zu erfahren verwendet man das „debconf-show“ Tool, Postfix muss auf dem Testsystem bereits installiert sein.

max@cmkdevel:/opt$ sudo debconf-show postfix
  postfix/procmail: false
  postfix/chattr: false
  postfix/recipient_delim: +
  postfix/sqlite_warning:
  postfix/dynamicmaps_conversion_warning:
  postfix/mydomain_warning:
  postfix/relayhost:
  postfix/compat_conversion_warning: true
  postfix/not_configured:
  postfix/rfc1035_violation: false
  postfix/root_address:
  postfix/protocols: all
  postfix/destinations: $myhostname, cmkdevel.m.local, localhost.m.local, , localhost
  postfix/kernel_version_warning:
  postfix/relay_restrictions_warning:
  postfix/mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
  postfix/mailbox_limit: 0
  postfix/tlsmgr_upgrade_warning:
* postfix/mailname: cmkdevel.m.local
* postfix/main_mailer_type: Internet Site
  postfix/bad_recipient_delimiter:
  postfix/main_cf_conversion_warning: true
  postfix/retry_upgrade_warning:

Um für ein neues System jetzt die Antworten dem Assistenten zu übergeben verwendet man das Tool „debconf-set-selections“. Der Kommandostapel setzt alle Optionen und Installiert automatisch Postfix.

debconf-set-selections <<< "postfix postfix/main_cf_conversion_warning string true"
debconf-set-selections <<< "postfix postfix/destinations string \$myhostname, $(hostname), localhost"
debconf-set-selections <<< "postfix postfix/root_address string max@m.local"
debconf-set-selections <<< "postfix postfix/bad_recipient_delimiter string ''"
debconf-set-selections <<< "postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128"
debconf-set-selections <<< "postfix postfix/recipient_delim string +"
debconf-set-selections <<< "postfix postfix/protocols string all"
debconf-set-selections <<< "postfix postfix/relayhost string mail.example.org"
debconf-set-selections <<< "postfix postfix/mailname string $(hostname)"
debconf-set-selections <<< "postfix postfix/mailbox_limit string 0"
debconf-set-selections <<< "postfix postfix/chattr string false"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Satellite system'"
apt-get install -y postfix

Viel Spaß 😉


Viewing all articles
Browse latest Browse all 144