清华源地址
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
image-20200920211725535在桌面新建tsinghua.list
cd ~/Desktop
touch tsinghua.list
sudo ln -s /home/{your name}/Desktop/tsinghua.list /etc/apt/sources.list.d/tsinghua.list
tsinghua.list内容
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-proposed main restricted universe multiverse
执行更新
apt-get update
可能会报如下错误:
image-20200920213146896这里需要执行以下命令
echo "sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys \$1" > add_apt_key.sh
chmod +x add_apt_key.sh
./add_apt_key.sh 871920D1991BC93C
重新执行更新就正常了
apt-get update
网友评论