feat: 添加 Tuna 源配置 (.sources)

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Konano 2026-04-26 17:03:09 +08:00
parent 6ceeb1011c
commit 74f5c8e5e3
Signed by: Nano
GPG Key ID: 93686B78EE43A65A
2 changed files with 17 additions and 0 deletions

View File

@ -24,6 +24,12 @@ configure_tuna() {
if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 0 ]]; then
sudo python3 $scriptdir/files/oh-my-tuna.py sudo python3 $scriptdir/files/oh-my-tuna.py
fi fi
# 如果 /etc/apt/sources.list.d/ubuntu.sources 存在且文件内有 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
fi
fi fi
} }

View File

@ -0,0 +1,11 @@
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/
Suites: noble noble-updates noble-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
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg