Ubuntu换阿里云源


最近,我发现...Ubuntu的官方源很慢,下载速度慢到爆炸,于是决定换阿里云源

首先 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 备份一下源文件,以防万一

在sudo vi /etc/apt/sources.list

把这个文件内容删除,改成以下(注:改成其他源也同理,还有Ubuntu好像有两个版本,一个是ubuntu一个是ubuntu-ports,不要弄错了,我就是因为弄错了apt全部不正常了)

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

然后保存就好了

最后,运行 sudo apt-get update 和 sudo apt-get upgrade 更新软件列表

最后终于摆脱了Ubuntu超慢的源,换了阿里云的源,如果有错误,欢迎在留言板留言

声明:吴先森的笔记|版权所有,违者必究|如未注明,均为原创

转载:转载请注明原文链接 - Ubuntu换阿里云源


为退烧而生