首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用preseed.cfg Ubuntu18.04.4安装软件?

如何使用preseed.cfg Ubuntu18.04.4安装软件?
EN

Ask Ubuntu用户
提问于 2020-03-24 10:13:31
回答 1查看 5.4K关注 0票数 3

我正在为UbuntuDesktop18.04.4创建一个无人值守的安装,我希望安装openssh-server (桌面的openssh-sftp-server),这样在安装完成后就可以使用ssh了。

我尝试过使用诸如:pkgsel/includeubiquity/success_commandpreseed/late_command之类的命令,但没有任何结果。

preseed不安装软件,也不更新软件包。

参考文献13.10的preseed.cfg中包含附加软件如何在Ubuntu

如果有任何帮助:

代码语言:javascript
复制
# 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`
EN

回答 1

Ask Ubuntu用户

发布于 2020-04-13 15:15:15

删除不必要的行

普遍性忽略预设/延迟命令,因此使用它没有意义。因此,您在这一行中包含了openssh-sftp-server包:

代码语言:javascript
复制
d-i pkgsel/include string openssh-sftp-server vim cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common

所以这些行可以被移除:

代码语言:javascript
复制
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测试了您的预置文件,可以找到这里。在选择屏幕上,我将光标移动到command-line install并按tab键。请注意屏幕底部显示的属性:

Ubuntu安装程序

然后追加这些属性,可以随意更改以下值:

代码语言:javascript
复制
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地址将明显不同。按回车和安装将继续和分期付款将只提示您回购服务器,因为它没有定义在您的预置文件。

安装完成后,您可以登录并确认是否安装了openssh-sftp-server和其他软件包。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1219749

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档