Ubuntu如何切换为清华镜像源

附上清华大学源的发布地址(该站包含Ubuntu、CnetOS、Fedora等主流Linux发行版下各版本的清华源):

 

第1步获取清华源信息:

打开下面的连接选择对应的系统版本,将会在页面生成对应的源信息

https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

https://mirrors4.tuna.tsinghua.edu.cn/help/ubuntu/

ubuntu3604ffa2ad34cc41.png

第2步,备份原来的源文件:

#备份原来的源文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

第3步,写入清华源:

cat>/etc/apt/sources.list <<-EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
EOF

第4步更新源:

apt-get update

版权声明:
作者:John
链接:https://vps.la/2020/04/15/ubuntu%e5%a6%82%e4%bd%95%e5%88%87%e6%8d%a2%e4%b8%ba%e6%b8%85%e5%8d%8e%e9%95%9c%e5%83%8f%e6%ba%90/
来源:VPS啦
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>