我刚刚从ubuntu-20.10-live-服务器-amd64.isoISO。
我这样做是因为20.10 没有 mini.iso。
我发现这个系统非常大(4.6 Gb!),有 577 个 deb 包,包含 Snaps(/折断为 506 Mb)、cloud-init
包和其他(对我来说)不需要的东西。
是否有可能将这样的系统转变为迷你iso类似的软件包?
答案1
通过仔细比较已安装的软件包列表和文件系统可以实现这一点。
为了获得参考,我们需要安装 20.04 LTS它是迷你iso然后将其升级到 20.10。
它没有snapd
,占用 3.8 Gb 并有 372 个 deb 包。
警告:如果您不确定或者已经在系统中安装或配置了很多东西,请不要继续。
首先我们需要删除 Snap:
sudo apt autopurge snapd
然后删除多余的包:
sudo apt autopurge alsa-topology-conf alsa-ucm-conf apport apport-symptoms at bc bcache-tools bolt btrfs-progs byobu cloud-guest-utils cloud-init cloud-initramfs-copymods cloud-initramfs-dyn-netconf cryptsetup cryptsetup-bin cryptsetup-initramfs cryptsetup-run curl dbus-user-session dconf-gsettings-backend:amd64 dconf-service dirmngr dmeventd eatmydata ethtool finalrd fonts-ubuntu-console fwupd fwupd-signed gawk gdisk gir1.2-packagekitglib-1.0 git git-man glib-networking:amd64 glib-networking-common glib-networking-services gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gsettings-desktop-schemas htop kpartx landscape-common libaio1:amd64 libappstream4:amd64 libarchive13:amd64 libasn1-8-heimdal:amd64 libasound2:amd64 libasound2-data libassuan0:amd64 libcanberra0:amd64 libcurl3-gnutls:amd64 libcurl4:amd64 libdbus-glib-1-2:amd64 libdconf1:amd64 libdevmapper-event1.02.1:amd64 libdw1:amd64 libeatmydata1:amd64 liberror-perl libevdev2:amd64 libevent-2.1-7:amd64 libfl2:amd64 libfwupd2:amd64 libfwupdplugin1:amd64 libgcab-1.0-0:amd64 libgdbm-compat4:amd64 libglib2.0-bin libgpgme11:amd64 libgpm2:amd64 libgssapi3-heimdal:amd64 libgstreamer1.0-0:amd64 libgudev-1.0-0:amd64 libgusb2:amd64 libhcrypto4-heimdal:amd64 libheimbase1-heimdal:amd64 libheimntlm0-heimdal:amd64 libhx509-5-heimdal:amd64 libimobiledevice6:amd64 libisns0:amd64 libjcat1:amd64 libjson-glib-1.0-0:amd64 libjson-glib-1.0-common libkrb5-26-heimdal:amd64 libksba8:amd64 libldap-2.4-2:amd64 libldap-common libltdl7:amd64 liblvm2cmd2.03:amd64 liblzo2-2:amd64 libmspack0:amd64 libnghttp2-14:amd64 libnpth0:amd64 libogg0:amd64 libopeniscsiusr0.2.0 libpackagekit-glib2-18:amd64 libperl5.30:amd64 libplist3:amd64 libpolkit-agent-1-0:amd64 libproxy1v5:amd64 libpython3.8:amd64 libreadline5:amd64 libroken18-heimdal:amd64 librtmp1:amd64 libsasl2-2:amd64 libsasl2-modules:amd64 libsasl2-modules-db:amd64 libsgutils2-2 libsigsegv2:amd64 libsmbios-c2 libsoup2.4-1:amd64 libssh-4:amd64 libstemmer0d:amd64 libtdb1:amd64 libtss2-esys0 libupower-glib3:amd64 liburcu6:amd64 libusbmuxd6:amd64 libutempter0:amd64 libvorbis0a:amd64 libvorbisfile3:amd64 libwind0-heimdal:amd64 libxmlb1:amd64 libxmlsec1:amd64 libxmlsec1-openssl:amd64 libxslt1.1:amd64 lvm2 lxd-agent-loader mdadm motd-news-config multipath-tools net-tools open-iscsi open-vm-tools overlayroot packagekit packagekit-tools pastebinit patch perl perl-modules-5.30 pinentry-curses policykit-1 pollinate python3-apport python3-attr python3-automat python3-blinker python3-click python3-colorama python3-configobj python3-constantly python3-cryptography python3-debconf python3-debian python3-distutils python3-hamcrest python3-httplib2 python3-hyperlink python3-importlib-metadata python3-incremental python3-jeepney python3-jinja2 python3-json-pointer python3-jsonpatch python3-jsonschema python3-jwt python3-keyring python3-launchpadlib python3-lazr.restfulclient python3-lazr.uri python3-lib2to3 python3-markupsafe python3-more-itertools python3-newt:amd64 python3-oauthlib python3-openssl python3-pexpect python3-problem-report python3-ptyprocess python3-pyasn1 python3-pyasn1-modules python3-pyrsistent:amd64 python3-requests-unixsocket python3-secretstorage python3-serial python3-service-identity python3-setuptools python3-simplejson python3-software-properties python3-systemd python3-twisted python3-twisted-bin:amd64 python3-wadllib python3-zipp python3-zope.interface run-one sbsigntool screen secureboot-db sg3-utils sg3-utils-udev software-properties-common sosreport sound-theme-freedesktop thermald thin-provisioning-tools tmux tpm-udev ubuntu-server unattended-upgrades update-notifier-common upower usbmuxd vim vim-runtime xfsprogs zerofree
然后安装系统中存在的软件包迷你iso和
sudo apt update
sudo apt install bsdmainutils calendar cpp cpp-10 dictionaries-common emacsen-common fdisk installation-report krb5-locales language-pack-en language-pack-en-base language-pack-gnome-en language-pack-gnome-en-base laptop-detect libfdisk1:amd64 libisl22:amd64 libmpc3:amd64 libmpdec2:amd64 libmpfr6:amd64 libsodium23:amd64 ncal popularity-contest python3-cffi-backend python3-nacl python3-pymacaroons tasksel tasksel-data wamerican wbritish
最后通过删除 Subiquity 安装系统的残余来调整配置文件:
sudo rm /etc/apt/apt.conf.d/90curtin-aptproxy
sudo rm /etc/apt/sources.list.curtin.old
sudo rm -rf /etc/cloud
sudo rm -rf /etc/multipath
sudo rm -rf /etc/network
sudo rm -rf /etc/pollinate
sudo rm -rf /etc/systemd/system/network-online.target.wants
sudo rm -rf /etc/systemd/system/snapd.service.d/
sudo rm /etc/crypttab
sudo mv /etc/netplan/00-installer-config.yaml /etc/netplan/01-netcfg.yaml
并通过添加配置文件迷你iso安装:
cat <<EOF | sudo tee /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: yes
EOF
cat <<EOF | sudo tee /etc/apt/apt.conf.d/00aptitude
Aptitude::Get-Root-Command "sudo:/usr/bin/sudo";
EOF
cat <<EOF | sudo tee /etc/apt/apt.conf.d/00trustcdrom
APT::Authentication::TrustCDROM "true";
EOF
cat <<EOF | sudo tee /etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
do_bootloader = no
do_initrd = yes
link_in_boot = yes
EOF
然后重新启动并享受。
正如您所看到的,上述过程有点困难,而且不方便用户使用。
所以我想提请大家注意这个问题,并邀请您参与在 Ubuntu Discourse 的民意调查中。