AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1273719
Accepted
marverix
marverix
Asked: 2020-09-09 22:27:12 +0800 CST2020-09-09 22:27:12 +0800 CST 2020-09-09 22:27:12 +0800 CST

Xubuntu 20.04 Automatic Ubiquity - 安装附加包

  • 772

我正在尝试openssh-server使用 Automatic Ubiquity Installator 在 Xubuntu 20.04 上安装。根据https://help.ubuntu.com/lts/installation-guide/amd64/apbs04.html点“B.4.11.包选择”,我可以使用

ubiquity pkgsel/include string openssh-server

这不起作用(未安装openssh服务器)。

根据https://wiki.ubuntu.com/UbiquityAutomation我可以使用ubiquity/success_command(或preseed/late_command)运行自己的命令......所以我尝试了这样的事情:

ubiquity ubiquity/success_command string \
    echo 'engineer ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/99_engineer; \
    chmod 440 /target/etc/sudoers.d/99_engineer; \
    chroot /target apt-get update; \
    chroot /target apt-get install -y openssh-server

也不工作。这很有趣,因为 sudoers 行似乎工作 - 只有 openssh-server 没有安装......

我做错了什么?什么 Ubuntu 20.04 发生了变化并且没有在任何地方记录?因为整个互联网上关于 Ubuntu 18.04 的所有示例都说上面应该可以工作。

system-installation ubiquity xubuntu
  • 2 2 个回答
  • 871 Views

2 个回答

  • Voted
  1. Best Answer
    marverix
    2020-09-12T08:09:45+08:002020-09-12T08:09:45+08:00

    最后,我深入研究了 Ubuntu 20.04 中使用的 Ubiquity 源代码,似乎开发人员已经删除了诸如pkgsel/include. Ubuntu 文档对此保持沉默。另外,我确认preseed/late_command没有被解雇。唯一有效的是ubiquity/success_command. 我不知道是不是从一开始就是这样,而是success_command用 运行sh -c "commands here",从我的测试来看,这意味着你无法在ubiquity/success_command. 经过很长时间的修补,我的最终(工作)解决方案是使用 cron 在重新启动后创建一个命令,该命令将等待 Internet 访问(通过检查8.8.8.8):

    ubiquity ubiquity/success_command string \
        mkdir -p /mnt/floppy; \
        mount -t vfat /dev/fd0 /mnt/floppy; \
        cp /mnt/floppy/sudoers /target/etc/sudoers.d/99_engineer; \
        chmod 440 /target/etc/sudoers.d/99_engineer; \
        mkdir -p /target/root; \
        cp /mnt/floppy/firstboot.sh /target/root/firstboot.sh; \
        chmod 750 /target/root/firstboot.sh; \
        echo '@reboot root bash /root/firstboot.sh >> /var/log/firstboot.log 2>&1' >> /target/etc/crontab;
    

    请注意,我在这里也使用了floppy_filesPacker - 这就是我可以使用/dev/fd0.

    sudoers文件:

    engineer ALL=(ALL) NOPASSWD:ALL
    

    firstboot.sh文件:

    #!/bin/bash
    
    echo "Waiting for Internet ..."
    while ! timeout 0.2 ping -c 1 -n 8.8.8.8 &> /dev/null
    do
        printf "%c" "."
    done
    echo "OK"
    
    # Instal SSH Server
    apt-get -y update
    apt-get -y install openssh-server
    
    # Remove from crontab
    sed -i '/firstboot/d' /etc/crontab
    

    顺便说一句,对于所有负责删除pkgsel/include和其他更改的人来说,这是一个巨大的减号,这些更改随处可见,目前在 中不起作用automatic-ubiquity,并且允许以简单的方式安装所需的额外内容。

    • 1
  2. CanDo
    2020-09-11T10:43:18+08:002020-09-11T10:43:18+08:00

    在我找到答案之前,我一直在为这个问题苦苦挣扎服务器几天。显然,安装程序在安装结束时关闭了网络接口。您需要启动网络接口以允许网络访问,以便它可以下载应用程序。试试这个,但更改接口名称 ens160 以匹配您的。

    ubiquity ubiquity/success_command string
    string ip link setup dev ens160;
    dhclient ens160;
    apt-get 更新 -y;
    目标内 apt-get install -y openssh-server;

    • 0

相关问题

  • Wubi 和常规的“Windows 旁边”安装有什么区别?

  • 如何在 Windows 7 中运行 Ubuntu?

  • 您对台式机和家庭服务器的驱动器分区方案有什么建议?[关闭]

  • 安装时,我可以选择加密我的主文件夹——这是做什么的?

  • 在不使用标准升级系统的情况下升级有哪些替代方案?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve