首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将包添加到基于subiquity的安装中

将包添加到基于subiquity的安装中
EN

Ask Ubuntu用户
提问于 2021-05-25 18:41:22
回答 1查看 1.2K关注 0票数 1

我通过添加ubuntu最小的桌面来构建服务器和台式机的安装,到目前为止,它只在连接到有线网络时才能工作。

因此,我想添加wpasupplicant和ubuntu-最小桌面和一些其他软件包到iso,所以根本不需要网络,有一个优雅的方式添加吗?

EN

回答 1

Ask Ubuntu用户

发布于 2021-07-04 09:38:46

我也一直在做这方面的工作,但为ubuntu实时服务器20.04工作。我不知道它是否适用于Ubuntu桌面。

其想法是在修改casper/filystem.squashfs并设置subiquity/autoinstall之后重新构建iso。但是有时,预装一些软件包似乎会破坏安装程序(比如ifenslave包),所以我在自动安装的后期阶段安装了这些软件包。

因此,要在iso上预装一些软件包,您有两种可能性:

修改capser/filystem.squashfs

总的想法是:

  1. 安装原始现场
  2. 装入casper/filystem.squashfs
  3. 安装你的软件包
  4. 重新包装新的casper/filystem.squashfs
  5. 更新iso上的其他一些文件。
  6. 重建iso

我用过的一些参考资料:

1

2

3.

安装包在自动安装

的后期阶段

这里的想法是使用apt下载软件包和缺少的依赖项,然后在自动安装后期命令阶段安装它们。这将意味着采取以下步骤:

  1. 把原始的活装装上。
  2. 挂载casper/filystem.squashfs。
  3. 色度和使用apt-get install --download-only -y -o Dir::Cache="/yourcache" -o Dir::Cache::archives="archives/" ${listOfPackages}。这将下载filesystem.squashfs中缺少的目标包及其依赖项。
  4. 安装subiquity自动安装,以便在自动安装过程的末尾安装这些包,如下所示:我试图通过指定缓存dir来使用apt安装,但是无法使用curtin。因此,我使用dpkg --unpack *.deb; apt-get install --no-download -yf。它不像使用apt那么干净,但对我来说它做到了
代码语言:javascript
复制
#cloud-config
autoinstall:
version: 1
interactive-sections:
# ...
late-commands:
    - curtin in-target --target=/target -- bash -c 'cd /yourcache/archives; dpkg --unpack *.deb; apt-get install --no-download -yf'
    # - curtin in-target --target=/target -- bash -c 'apt-get install --print-uris --no-download -y -f -o Dir::Cache="/awrepo" -o Dir::Cache::archives="archives/" __PARAM_PACKAGES_POST__' # doesn't work. use dpkg --unpack instead
    - curtin in-target --target=/target -- apt-get --purge -y --quiet=2 autoremove
    - curtin in-target --target=/target -- apt-get clean

以下是所有这一切的要点:https://gist.github.com/creatldd1/eec887f3f8a0bf48e0e9dec1598b8614

注意:本地apt缓存的另一种选择是在iso上构建本地apt回购并配置apt来使用它。问题是回购的规模可能是巨大的。这是我的第一次尝试,但我放弃了。

配置简单回购:https://unix.stackexchange.com/a/595448/402499的伟大链接。

下载包及其依赖项的代码,递归地:

代码语言:javascript
复制
listPkg=$(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks ${theListofPackages} | grep "^\w" | sort --unique )
for pkg in ${listPkg}
do
    if ! apt-get download ${pkg}; then
        echo >&2 " WARNING : problem fetching package ${pkg}. Keeping on"
    fi
done

有关这方面的更多信息,请查看https://stackoverflow.com/questions/22008193/how-to-list-download-the-recursive-dependencies-of-a-debian-package

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

https://askubuntu.com/questions/1340655

复制
相关文章

相似问题

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