修改ubuntu18.04 apt源为阿里云(aliyun)镜像

打开terminal,备份原文件

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

进入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

参考 阿里云镜像官网

posted @ 2019-05-14 14:33  GMonster  阅读(12106)  评论(0编辑  收藏  举报