Entfernen Sie unnötige Zeilen

Entfernen Sie unnötige Zeilen

Ich erstelle eine unbeaufsichtigte Installation mit Preseed für Ubuntu Desktop 18.04.4 und möchte die Installation openssh-server( openssh-sftp-serverfür den Desktop) so durchführen, dass nach Abschluss der Installation tatsächlich eine SSH-Verbindung möglich ist.

Ich habe versucht, Befehle wie die folgenden zu verwenden: pkgsel/include, ubiquity/success_commandaber preseed/late_commandohne Erfolg.

Das Preseed installiert keine Software und aktualisiert auch keine Pakete.

ReferenzSo schließen Sie zusätzliche Software in preseed.cfg für Ubuntu Server 13.10 ein

Falls etwas hilft:

# 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`

Antwort1

Entfernen Sie unnötige Zeilen

Allgegenwartignoriertpreseed/late_command, daher ist es sinnlos, es zu verwenden. Daher haben Sie das openssh-sftp-server-Paket in diese Zeile aufgenommen:

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

Daher können diese Zeilen entfernt werden:

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;

So nutzen Sie Allgegenwärtigkeit

Ich habe Ihre Preseed-Datei mit Ubuntu Minimal ISO getestet, das Sie finden könnenHier. Auf dem Auswahlbildschirm habe ich den Cursor auf bewegt command-line installund gedrücktTabSchlüssel. Beachten Sie die Attribute, die unten auf dem Bildschirm angezeigt werden:

Ubuntu-Installationsprogramm

Fügen Sie dann diese Attribute hinzu und ändern Sie die Werte nach Belieben:

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

Die Preseed-Datei kann auf dem lokalen Host Ihres Hostcomputers gehostet werden, beispielsweise mithilfe von python3 -m http.server. Ihre IP-Adresse wird natürlich abweichen. Drücken Sie die Eingabetaste und die Installation wird fortgesetzt. Das Installationsprogramm fordert Sie nur zur Eingabe des Repo-Servers auf, da dieser in Ihrer Preseed-Datei nicht definiert ist.

Nachdem die Installation abgeschlossen ist, können Sie sich anmelden und bestätigen, dass openssh-sftp-serverdie anderen Pakete installiert wurden.

verwandte Informationen