preseed/late_command 甚至 ubiquity/success_command 不起作用

preseed/late_command 甚至 ubiquity/success_command 不起作用

我正在嘗試建立 ubuntu 18.04 iso 以使用 Preseed 檔案自動安裝。不知何故, preseed/late_command 和 ubiquity/success_command 似乎都沒有生效。

我無法在目標系統上安裝 iptables-persistent 或 docker。

這是我的預置文件。

*### Unattended Installation

d-i auto-install/enable boolean true
d-i debconf/priority select critical

d-i debian-installer/locale string en_US.UTF-8
d-i localechooser/supported-locales multiselect en_US.UTF-8
d-i console-setup/ask_detect boolean false

d-i /choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i hw-detect/load_firmware boolean true

d-i     netcfg/wireless_wep     string

d-i mirror/country string manual
d-i mirror/http/hostname string archive.ubuntu.com
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string

d-i clock-setup/utc boolean true
d-i time/zone string UTC
d-i clock-setup/ntp boolean true

d-i base-installer/install-recommends boolean true
d-i base-installer/kernel/override-image    string linux-server
d-i base-installer/kernel/override-image    string linux-image-amd64
d-i debconf debconf/frontend select Noninteractive

d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i apt-setup/backports boolean true
d-i apt-setup/use_mirror boolean false
d-i apt-setup/services-select multiselect security, updates
d-i apt-setup/security_host string security.ubuntu.com
d-i apt-setup/security_path string /ubuntu

d-i tasksel/first multiselect none
d-i pkgsel/install-recommends boolean true
d-i pkgsel/include string openssh-server python
d-i pkgsel/upgrade select full-upgrade
d-i pkgsel/update-policy select unattended-upgrades


iptables-persistent iptables-persistent/autosave_v4 boolean true

iptables-persistent iptables-persistent/autosave_v6 boolean false
d-i pkgsel/include string openssh-server \
    vim \
    git \
    build-essential \
    wget \
    curl \
    python3 \
    iptables-persistent \
    netfilter-persistent \
    docker \
    docker-compose

#d-i preseed/late_command string \
ubiquity ubiquity/success_command string \
 in-target apt-get update; \
 in-target apt-get -y upgrade; \
 in-target apt-get -y autoremove ; \
 in-target apt-get autoclean ; \
 in-target apt-get -y install iptables-persistent netfilter-persistent; \
 in-target apt-get -y install docker*; \
 in-target sh -c 'sed -i "s/^#PermitRootLogin.*\$/PermitRootLogin no/g" /etc/ssh/sshd_config'
d-i debian-installer/splash boolean false
d-i cdrom-detect/eject boolean true*

嘗試了 preseed Late_command 和 ubiquity/success_command,但它們都不起作用。由於舊錯誤,也找不到任何日誌E: Can not write log (Is /dev/pts mounted?) - openpty (2: No such file or directory)

openssh安裝完成後,就直接進行無人值守的安全性升級。

相關內容