Skip to content

Commit

Permalink
使用 --ci 安装 Debian 时 CN 环境修改为国内源
Browse files Browse the repository at this point in the history
  • Loading branch information
akarin233 authored and bin456789 committed Feb 5, 2025
1 parent 2e1702e commit 4afbd5a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions trans.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2767,8 +2767,14 @@ EOF
# 获取当前开启的 Components, 后面要用
if [ -f $os_dir/etc/apt/sources.list.d/debian.sources ]; then
comps=$(grep ^Components: $os_dir/etc/apt/sources.list.d/debian.sources | head -1 | cut -d' ' -f2-)
if is_in_china; then
sed -i 's|[a-zA-Z.-]*\.debian\.org|mirror.nju.edu.cn|g' $os_dir/etc/apt/mirrors/debian.list $os_dir/etc/apt/mirrors/debian-security.list
fi
else
comps=$(grep '^deb ' $os_dir/etc/apt/sources.list | head -1 | cut -d' ' -f4-)
if is_in_china; then
sed -i 's|[a-zA-Z.-]*\.debian\.org|mirror.nju.edu.cn|g' $os_dir/etc/apt/sources.list
fi
fi

# EOL 处理
Expand Down

0 comments on commit 4afbd5a

Please # to comment.