diff --git a/configure_priv.sh b/configure_priv.sh index 342547d..7f68efd 100755 --- a/configure_priv.sh +++ b/configure_priv.sh @@ -28,7 +28,7 @@ configure_tuna() { if [ -f /etc/apt/sources.list.d/ubuntu.sources ] && grep -q tuna /etc/apt/sources.list.d/ubuntu.sources; then echo "检测到已切换到 Tuna 源,跳过覆盖。" else - sudo cp $scriptdir/files/sources.list/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources + sed "s|__CODENAME__|$(lsb_release -cs)|g" "$scriptdir/files/sources.list/ubuntu.sources" | sudo tee /etc/apt/sources.list.d/ubuntu.sources >/dev/null fi fi } diff --git a/files/sources.list/ubuntu.sources b/files/sources.list/ubuntu.sources index 66990fc..f11b4ef 100644 --- a/files/sources.list/ubuntu.sources +++ b/files/sources.list/ubuntu.sources @@ -1,11 +1,11 @@ Types: deb URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ -Suites: noble noble-updates noble-backports +Suites: __CODENAME__ __CODENAME__-updates __CODENAME__-backports Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg Types: deb URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ -Suites: noble-security +Suites: __CODENAME__-security Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg