我通过添加ubuntu最小的桌面来构建服务器和台式机的安装,到目前为止,它只在连接到有线网络时才能工作。
因此,我想添加wpasupplicant和ubuntu-最小桌面和一些其他软件包到iso,所以根本不需要网络,有一个优雅的方式添加吗?
发布于 2021-07-04 09:38:46
我也一直在做这方面的工作,但为ubuntu实时服务器20.04工作。我不知道它是否适用于Ubuntu桌面。
其想法是在修改casper/filystem.squashfs并设置subiquity/autoinstall之后重新构建iso。但是有时,预装一些软件包似乎会破坏安装程序(比如ifenslave包),所以我在自动安装的后期阶段安装了这些软件包。
因此,要在iso上预装一些软件包,您有两种可能性:
总的想法是:
我用过的一些参考资料:
的后期阶段
这里的想法是使用apt下载软件包和缺少的依赖项,然后在自动安装后期命令阶段安装它们。这将意味着采取以下步骤:
apt-get install --download-only -y -o Dir::Cache="/yourcache" -o Dir::Cache::archives="archives/" ${listOfPackages}。这将下载filesystem.squashfs中缺少的目标包及其依赖项。dpkg --unpack *.deb; apt-get install --no-download -yf。它不像使用apt那么干净,但对我来说它做到了#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的伟大链接。
下载包及其依赖项的代码,递归地:
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
https://askubuntu.com/questions/1340655
复制相似问题