刪除不必要的行

刪除不必要的行

我正在使用 Ubuntu Desktop 18.04.4 的 preseed 建立無人值守安裝,並且我想安裝openssh-serveropenssh-sftp-server對於桌面),使其在安裝完成後實際上可以進行 ssh。

我嘗試過使用以下命令:pkgsel/includeubiquity/success_commandpreseed/late_command沒有任何運氣。

預置不會安裝軟體,也不更新軟體包。

參考號如何在 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 測試了你的預置文件,可以找到它這裡。在選擇畫面上,我將遊標移至command-line install並按下標籤鑰匙。注意螢幕底部出現的屬性:

Ubuntu安裝程式

然後附加這些屬性,隨意更改值:

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

預置檔案可以託管在主機的本機主機上,例如使用python3 -m http.server.您的 IP 位址將明顯不同。按 Enter 鍵,安裝將繼續,安裝程式只會提示您輸入儲存庫伺服器,因為它未在您的預置檔案中定義。

安裝完成後,您可以登入並確認openssh-sftp-server其他軟體包已安裝。

相關內容