feat: 添加 Tuna 源配置 (.sources)
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
6ceeb1011c
commit
74f5c8e5e3
@ -24,6 +24,12 @@ configure_tuna() {
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
sudo python3 $scriptdir/files/oh-my-tuna.py
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
11
files/sources.list/ubuntu.sources
Normal file
11
files/sources.list/ubuntu.sources
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user