修改Ubuntu的镜像源为清华镜像源
1、首先使用以下命令备份现有的镜像源:
cd /etc/apt
sudo cp sources.list sources.list.bak
2、使用以下命令打开镜像源文件:
sudo vim /etc/apt/sources.list
3、在vim插入模式下使用以下内容替换掉原镜像源文件sources.list中的内容:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
4、保存并退出。
5、在ubuntu能正常上网的前提下,使用以下命令更新软件列表:
sudo apt-get update
sudo apt-get upgrade
经过以上流程,ubuntu使用的镜像源就是清华的镜像源了。