修改Ubuntu的镜像源为阿里云镜像源
1、首先使用以下命令备份现有的镜像源:
cd /etc/apt
sudo cp sources.list sources.list.bak
2、使用以下命令打开镜像源文件:
sudo vim /etc/apt/sources.list
3、在vim插入模式下使用以下内容替换掉原镜像源文件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
4、保存并退出。
5、在ubuntu能正常上网的前提下,使用以下命令更新软件列表:
sudo apt-get update
sudo apt-get upgrade
经过以上流程,ubuntu使用的镜像源就是阿里云的镜像源了。