修改ubuntu 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-12-26 14:25  #随风飘散  阅读(1029)  评论(0编辑  收藏  举报