Ubuntu20.04如何更换国内源-阿里云源

1.备份源文件

bash 复制代码
cp /etc/apt/sources.list /etc/apt/sources.list.bak

2.打开源文件,注释默认的源

bash 复制代码
vim /etc/apt/sources.list
bash 复制代码
## 注释原本内容
# deb http://mirrors.ivolces.com/ubuntu/ focal main restricted universe multiverse
# deb-src http://mirrors.ivolces.com/ubuntu/ focal main restricted universe multiverse

# deb http://mirrors.ivolces.com/ubuntu/ focal-security main restricted universe multiverse
# deb-src http://mirrors.ivolces.com/ubuntu/ focal-security main restricted universe multiverse

# deb http://mirrors.ivolces.com/ubuntu/ focal-updates main restricted universe multiverse
# deb-src http://mirrors.ivolces.com/ubuntu/ focal-updates main restricted universe multiverse

# deb http://mirrors.ivolces.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src http://mirrors.ivolces.com/ubuntu/ focal-proposed main restricted universe multiverse

# deb http://mirrors.ivolces.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://mirrors.ivolces.com/ubuntu/ focal-backports main restricted universe multiverse

## 添加新内容

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

3.保存退出ESC+:wq!

4.更新源

bash 复制代码
apt-get update

5.更新系统软件

bash 复制代码
apt-get dist-upgrade
apt-get upgrade
相关推荐
Karoku0661 分钟前
【docker集群应用】Docker网络与资源控制
运维·数据库·docker·容器
梦游钓鱼8 分钟前
pyshark安装使用,ubuntu:20.04
linux·运维·ubuntu
火龙谷11 分钟前
CentOS7将yum源更换为国内源教程
linux·centos
战族狼魂35 分钟前
CentOS 上安装各种应用的命令行总结
linux·运维·centos
学Linux的语莫1 小时前
ansible变量
linux·运维·服务器·ansible
北京迅为1 小时前
【北京迅为】iTOP-4412全能版使用手册-第十二章 Linux系统编程简介
linux·嵌入式硬件·4412开发板
清源妙木真菌1 小时前
Linux:进程控制
linux
爱吃喵的鲤鱼1 小时前
Linux——文件系统清尾、动静态库
linux·运维·服务器
最数据2 小时前
Linux或者Docker中时区查询和修改(差8小时问题)
linux·运维·服务器·docker·.net
mahuifa2 小时前
ubuntu设置程序开机自启动
服务器·ubuntu·开机自启动