Ubuntu20.04更改下载源为国内下载源

Ubuntu更改下载源为国内下载源

备份默认下载源

cp /etc/apt/sources.list /etc/apt/sources.list.bak

进入该目录

cd /etc/apt
ll

Ubuntu20.04更改下载源为国内下载源

清空并编辑配置文件

echo "" > sources.list
vim /etc/apt/sources.list 

如果没有 vim 请下载

sudo apt install vim

阿里云镜像源

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

清华大学镜像源

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse 
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse 
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse 
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse 
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

网易镜像源

deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse 
deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse 
deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse 
deb http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse 
deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse 
deb-src http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse 
deb-src http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse 
deb-src http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse 
deb-src http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse 
deb-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse

中科大镜像源

deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse 
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse 
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse 
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse 
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse 
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse 
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse 
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse 
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse 
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

保存退出

更新软件包

sudo apt update
 
sudo apt upgrade 
上一篇:Ubuntu系统初始化


下一篇:ubuntu 18.04常用软件安装及配置个人使用记录