From 836ba3f1f1e9e15dd572f38e7570e34de72af16b Mon Sep 17 00:00:00 2001 From: bin456789 Date: Wed, 22 May 2024 21:44:21 +0800 Subject: [PATCH] =?UTF-8?q?ubuntu:=20=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E5=9B=BD=E5=86=85=E6=BA=90=E6=97=B6=E6=B2=A1=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=2024.04=20=E6=96=B0=E5=A2=9E=E7=9A=84=20ubuntu.sources?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/trans.sh b/trans.sh index e125b04..4bdac8a 100644 --- a/trans.sh +++ b/trans.sh @@ -2332,7 +2332,16 @@ EOF # 更改源 if is_in_china; then - sed -i 's/archive.ubuntu.com/cn.archive.ubuntu.com/' $os_dir/etc/apt/sources.list + # 22.04 使用 /etc/apt/sources.list + # 24.04 使用 /etc/apt/sources.list.d/ubuntu.sources + for file in $os_dir/etc/apt/sources.list $os_dir/etc/apt/sources.list.d/ubuntu.sources; do + if [ -f $file ]; then + # cn.archive.ubuntu.com 不在国内还严重丢包 + # https://www.itdog.cn/ping/cn.archive.ubuntu.com + sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/' $file # x64 + sed -i 's/ports.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/' $file # arm + fi + done fi # 安装最佳内核