修改ubuntu18.04 apt源为aliyun

打开terminal,进入apt源配置目录

cd /etc/apt/sources.list.d/
sudo vim aliyun.list

按i进入vim编辑模式

将以下内容复制到aliyun.list中

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-proposed main restricted universe multiverse
deb-src 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-backports main restricted universe multiverse

按ESC退出编辑模式,按:wq退出vim并保存该文件

在terminal中运行以下命令即完成

sudo apt-get update

参考 阿里云镜像官网

上一篇:win10 linux Ubuntu 18.04更换国内源


下一篇:拿到一个新的Ubuntu,你应该这样设置Python环境