2019-11-30 09:06:09 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -xe;
|
|
|
|
|
|
|
|
if type "tee" 2>/dev/null && [ -n "${UBUNTU_SOURCE}" ]; then
|
|
|
|
SOURCE_PATH="/etc/apt/sources.list"
|
|
|
|
cp ${SOURCE_PATH} ${SOURCE_PATH}.bak && rm -rf ${SOURCE_PATH}
|
|
|
|
case "${UBUNTU_SOURCE}" in
|
|
|
|
"aliyun")
|
|
|
|
tee ${SOURCE_PATH} <<-'EOF'
|
2021-06-04 22:22:51 +08:00
|
|
|
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
|
|
|
|
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
|
|
|
|
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
|
|
|
|
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
|
|
|
|
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
|
|
|
|
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
|
|
|
|
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
|
|
|
|
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
|
|
|
|
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
|
|
|
|
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
|
2019-11-30 09:06:09 +08:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
"zju")
|
|
|
|
tee ${SOURCE_PATH} <<-'EOF'
|
2021-06-04 22:22:51 +08:00
|
|
|
deb http://mirrors.zju.edu.cn/ubuntu/ focal main multiverse restricted universe
|
|
|
|
deb http://mirrors.zju.edu.cn/ubuntu/ focal-backports main multiverse restricted universe
|
|
|
|
deb http://mirrors.zju.edu.cn/ubuntu/ focal-proposed main multiverse restricted universe
|
|
|
|
deb http://mirrors.zju.edu.cn/ubuntu/ focal-security main multiverse restricted universe
|
|
|
|
deb http://mirrors.zju.edu.cn/ubuntu/ focal-updates main multiverse restricted universe
|
|
|
|
deb-src http://mirrors.zju.edu.cn/ubuntu/ focal main multiverse restricted universe
|
|
|
|
deb-src http://mirrors.zju.edu.cn/ubuntu/ focal-backports main multiverse restricted universe
|
|
|
|
deb-src http://mirrors.zju.edu.cn/ubuntu/ focal-proposed main multiverse restricted universe
|
|
|
|
deb-src http://mirrors.zju.edu.cn/ubuntu/ focal-security main multiverse restricted universe
|
|
|
|
deb-src http://mirrors.zju.edu.cn/ubuntu/ focal-updates main multiverse restricted universe
|
2019-11-30 09:06:09 +08:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
"tsinghua")
|
|
|
|
tee ${SOURCE_PATH} <<-'EOF'
|
2021-06-04 22:22:51 +08:00
|
|
|
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
|
|
|
|
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
|
|
|
|
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
|
|
|
|
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
|
|
|
|
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
|
|
|
|
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
|
|
|
|
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
|
|
|
|
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
|
|
|
|
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
|
|
|
|
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
|
2019-11-30 09:06:09 +08:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
"163")
|
|
|
|
tee ${SOURCE_PATH} <<-'EOF'
|
2021-06-04 22:22:51 +08:00
|
|
|
deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
|
|
|
|
deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
|
|
|
|
deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
|
|
|
|
deb http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
|
|
|
|
deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
|
|
|
|
deb-src http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
|
|
|
|
deb-src http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
|
|
|
|
deb-src http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
|
|
|
|
deb-src http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
|
|
|
|
deb-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
|
2019-11-30 09:06:09 +08:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
"ustc")
|
|
|
|
tee ${SOURCE_PATH} <<-'EOF'
|
2021-06-04 22:22:51 +08:00
|
|
|
deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
|
|
|
|
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
|
|
|
|
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
|
|
|
|
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
|
|
|
|
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
|
|
|
|
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
|
|
|
|
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
|
|
|
|
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
|
|
|
|
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
|
|
|
|
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
|
2019-11-30 09:06:09 +08:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Please check whether there is aliyun|zju|tsinghua|163|ustc in the parameter"
|
|
|
|
exit 1;;
|
|
|
|
esac
|
2021-06-04 22:22:51 +08:00
|
|
|
fi
|