ubuntu apt-get 更换清华源设置

ubutun agt-get 清华源地址为:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
1.备份ubuntu 中/etc/apt/sources.list
ubuntu apt-get  更换清华源设置
sudo cp sources.list sources.list.bak
2.编辑sources.list
选择ubutun对应的系统版本(我用的是 ubutun 16.04 LTS),拷贝对应内容覆盖sources.list文件:

# 默认注释了源码镜像以提高 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

3 查看是否可以更新
ubuntu apt-get  更换清华源设置
chenfuhai@devstack-compute:~$ sudo apt-get update

上一篇:pip源改回国内


下一篇:【完整】Win10安装tensorflow-1.4.0-cpu-python3.5版本