From c8e7f3a62472a8e4d64d925402dc429832c3e1fb Mon Sep 17 00:00:00 2001 From: iBug Date: Tue, 27 Aug 2024 23:47:06 +0800 Subject: [PATCH] Migrate sources.list to deb822 --- labstrap | 8 +++++--- rootfs/etc/apt/sources.list | 11 +---------- rootfs/etc/apt/sources.list.d/ubuntu.sources | 14 ++++++++++++++ rootfs/etc/skel/.config/mate/backgrounds.xml | 2 +- rootfs/tmp/dconf/user.conf | 2 +- 5 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 rootfs/etc/apt/sources.list.d/ubuntu.sources diff --git a/labstrap b/labstrap index 6b80d9a..41adce4 100755 --- a/labstrap +++ b/labstrap @@ -71,7 +71,8 @@ run sh -c 'dpkg --get-selections | cut -f1 | xargs apt-mark auto' rm -f "$DST/etc/resolv.conf" cp -f /etc/resolv.conf "$DST/etc/resolv.conf" add_file /etc/apt/ -run sed -i "s,%APT_SOURCE%,${APT_SOURCE:-https://mirrors.ustc.edu.cn},g" /etc/apt/sources.list +chattr +i "$DST/etc/apt/sources.list" || true +run sed -i "s,%APT_SOURCE%,${APT_SOURCE:-https://mirrors.ustc.edu.cn},g" /etc/apt/sources.list.d/ubuntu.sources run apt-get update run apt-get -y dist-upgrade @@ -158,8 +159,8 @@ run apt-mark auto bash-completion cron wget run apt-get clean # Set the apt source of the resulting image to USTC mirrors -add_file /etc/apt/sources.list -run sed -i "s,%APT_SOURCE%,https://mirrors.ustc.edu.cn,g" /etc/apt/sources.list +add_file /etc/apt/sources.list.d/ubuntu.sources +run sed -i "s,%APT_SOURCE%,https://mirrors.ustc.edu.cn,g" /etc/apt/sources.list.d/ubuntu.sources # Touching hicolor cache to be very old to force it rebuild on startup # As /opt/vlab is inaccessible when building @@ -175,3 +176,4 @@ rm -rf "$DST/var/lib/apt/lists"/* "$DST/var/lib/dpkg"/*-old rm -rf "$DST/var/cache"/* rm "$DST/etc/resolv.conf" rm -rf "$DST/etc/ssh"/ssh_host_*_key{,.pub} +rmdir "$DST"/*.usr-is-merged diff --git a/rootfs/etc/apt/sources.list b/rootfs/etc/apt/sources.list index 0ced311..89f70c9 100644 --- a/rootfs/etc/apt/sources.list +++ b/rootfs/etc/apt/sources.list @@ -1,10 +1 @@ -# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 -deb %APT_SOURCE%/ubuntu/ noble main restricted universe multiverse -#deb-src %APT_SOURCE%/ubuntu/ noble main restricted universe multiverse -deb %APT_SOURCE%/ubuntu/ noble-updates main restricted universe multiverse -#deb-src %APT_SOURCE%/ubuntu/ noble-updates main restricted universe multiverse -deb %APT_SOURCE%/ubuntu/ noble-security main restricted universe multiverse -#deb-src %APT_SOURCE%/ubuntu/ noble-security main restricted universe multiverse - -# For libncurses5 -deb %APT_SOURCE%/ubuntu/ jammy universe +# See /etc/apt/sources.list.d/ubuntu.sources diff --git a/rootfs/etc/apt/sources.list.d/ubuntu.sources b/rootfs/etc/apt/sources.list.d/ubuntu.sources new file mode 100644 index 0000000..2d8a557 --- /dev/null +++ b/rootfs/etc/apt/sources.list.d/ubuntu.sources @@ -0,0 +1,14 @@ +# 默认未添加源码镜像以提高 apt update 速度,如有需要可在 Types: 后面自行添加 deb-src +# 参见 https://mirrors.ustc.edu.cn/help/ubuntu.html +Types: deb +URIs: %APT_SOURCE%/ubuntu/ +Suites: noble noble-updates noble-security +Components: main restricted universe multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg + +# For libncurses5 +Types: deb +URIs: %APT_SOURCE%/ubuntu/ +Suites: jammy +Components: universe +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg diff --git a/rootfs/etc/skel/.config/mate/backgrounds.xml b/rootfs/etc/skel/.config/mate/backgrounds.xml index 5743718..fb79f71 100644 --- a/rootfs/etc/skel/.config/mate/backgrounds.xml +++ b/rootfs/etc/skel/.config/mate/backgrounds.xml @@ -3,7 +3,7 @@ USTC Vlab - /opt/vlab/share/background.png + /opt/vlab/share/background-24.04.jpg zoom vertical-gradient rgb(88,145,188) diff --git a/rootfs/tmp/dconf/user.conf b/rootfs/tmp/dconf/user.conf index f0db270..617b5ab 100644 --- a/rootfs/tmp/dconf/user.conf +++ b/rootfs/tmp/dconf/user.conf @@ -63,7 +63,7 @@ togglekeys-enable=false [org/mate/desktop/background] color-shading-type='vertical-gradient' -picture-filename='/opt/vlab/share/background.png' +picture-filename='/opt/vlab/share/background-24.04.jpg' picture-options='zoom' primary-color='rgb(88,145,188)' secondary-color='rgb(60,143,37)'