Skip to content

Commit

Permalink
Migrate sources.list to deb822
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Aug 27, 2024
1 parent 0693f7b commit c8e7f3a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
8 changes: 5 additions & 3 deletions labstrap
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
11 changes: 1 addition & 10 deletions rootfs/etc/apt/sources.list
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions rootfs/etc/apt/sources.list.d/ubuntu.sources
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion rootfs/etc/skel/.config/mate/backgrounds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<wallpapers>
<wallpaper deleted="false">
<name>USTC Vlab</name>
<filename>/opt/vlab/share/background.png</filename>
<filename>/opt/vlab/share/background-24.04.jpg</filename>
<options>zoom</options>
<shade_type>vertical-gradient</shade_type>
<pcolor>rgb(88,145,188)</pcolor>
Expand Down
2 changes: 1 addition & 1 deletion rootfs/tmp/dconf/user.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand Down

0 comments on commit c8e7f3a

Please sign in to comment.