不要な行を削除する

不要な行を削除する

Ubuntu Desktop 18.04.4 の preseed を使用して無人インストールを作成しており、インストールが完了した後に実際に ssh ができるように openssh-server(デスクトップ用) をインストールしたいと考えています。openssh-sftp-server

などのコマンドを使用してみましたがpkgsel/include、うまくいきませんでしたubiquity/success_commandpreseed/late_command

preseed はソフトウェアをインストールせず、パッケージも更新しません。

参照Ubuntu Server 13.10 の preseed.cfg に追加ソフトウェアを含める方法

何か助けがあれば:

# Installer config
d-i base-installer/kernel/override-image string linux-image-amd64

# GRUB
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true

# Setting the locales, country
# Supported locales available in /usr/share/i18n/SUPPORTED
d-i debian-installer/language string en
d-i debian-installer/country string IN
d-i debian-installer/locale string en_US.UTF-8

# Keyboard setting
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i keyboard-configuration/xkb-keymap us
d-i keyboard-configuration/modelcode string pc105

# Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/enable boolean true
d-i netcfg/get_hostname string ubuntu-bionic-desktop
d-i netcfg/get_domain string localdomain
d-i netcfg/wireless_wep string
# d-i hw-detect/load_firmware boolean true

# Mirror settings
choose-mirror-bin mirror/http/proxy string

# Clock and time zone setup
d-i time/zone string UTC
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i clock-setup/ntp boolean true

# Disk and Partitioning setup
d-i partman-auto/disk string /dev/sda
d-i partman-auto-lvm/guided_size string max
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/method string lvm
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_write_new_label boolean true

# Vagrant user creation
d-i passwd/user-fullname string vagrant
d-i passwd/username string vagrant
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i user-setup/encrypt-home boolean false
d-i user-setup/allow-password-weak boolean true
d-i passwd/user-default-groups vagrant sudo

# Package installations

d-i pkgsel/include string openssh-sftp-server vim cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common
# Upgrading the system
d-i pkgsel/install-language-support boolean false
d-i pkgsel/update-policy select none
d-i pkgsel/upgrade select full-upgrade
tasksel tasksel/first multiselect standard, ubuntu-desktop

ubiquity ubiquity/use_nonfree boolean true

d-i preseed/late_command string apt-install openssh-sftp-server;

# Success Installation - Tasks
ubiquity ubiquity/success_command string  \
    in-target apt install openssh-sftp-server;

# Installation - final
d-i finish-install/reboot_in_progress note
ubiquity ubiquity/summary note
ubiquity ubiquity/reboot boolean true`

答え1

不要な行を削除する

ユビキタス無視するpreseed/late_command なので、これを使用する意味はありません。したがって、次の行に openssh-sftp-server パッケージを含めます。

d-i pkgsel/include string openssh-sftp-server vim cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common

したがって、これらの行は削除できます。

d-i preseed/late_command string apt-install openssh-sftp-server;

# Success Installation - Tasks
ubiquity ubiquity/success_command string  \
    in-target apt install openssh-sftp-server;

ユビキタスを活用する方法

私はUbuntuの最小限のISOを使用してpreseedファイルをテストしました。ここ選択画面でカーソルを移動してcommand-line install押しましたタブキー。画面の下部に表示された属性に注目してください。

Ubuntuインストーラー

次に、次の属性を追加します。値は自由に変更できます。

locale=en_US hostname=ubuntu keyboard-configuration/modelcode=SKIP ubiquity url=http://192.168.0.1:8000/preseed-ubuntu.cfg

preseed ファイルは、たとえば を使用して、ホスト マシンの localhost にホストできますpython3 -m http.server。IP アドレスは明らかに異なります。Enter キーを押すとインストールが続行され、preseed ファイルで定義されていないため、インストーラーはリポジトリ サーバーの入力を求めるプロンプトのみを表示します。

インストールが完了したら、ログインして、openssh-sftp-serverその他のパッケージがインストールされているかどうかを確認できます。

関連情報