美文网首页
Ubuntu 16.04 更换apt源为国内源

Ubuntu 16.04 更换apt源为国内源

作者: shenghaishxt | 来源:发表于2019-05-05 19:57 被阅读0次

本文来自我的个人博客 https://www.zhangshenghai.com/posts/9484/

直接使用国外源的话太慢了,试了几个国内的镜像源,感觉还是阿里源最快。现在北京时间2019年3月12日有效。

首先备份 sources.list:

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

删除 /etc/apt/sources.list 下的内容,修改为:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

然后更新源试试:

sudo apt-get update
sudo apt-get upgrade

相关文章

网友评论

      本文标题:Ubuntu 16.04 更换apt源为国内源

      本文链接:https://www.haomeiwen.com/subject/oeckoqtx.html