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
相关推荐
宁zz16 小时前
乌班图安装jenkins
运维·jenkins
大丈夫立于天地间16 小时前
ISIS协议中的数据库同步
运维·网络·信息与通信
cg501716 小时前
Spring Boot 的配置文件
java·linux·spring boot
暮云星影17 小时前
三、FFmpeg学习笔记
linux·ffmpeg
rainFFrain17 小时前
单例模式与线程安全
linux·运维·服务器·vscode·单例模式
GalaxyPokemon17 小时前
Muduo网络库实现 [九] - EventLoopThread模块
linux·服务器·c++
mingqian_chu17 小时前
ubuntu中使用安卓模拟器
android·linux·ubuntu
Zero_to_zero123418 小时前
解决docker的ubuntu系统中文乱码问题
ubuntu·docker·容器
@郭小茶18 小时前
docker-compose方式部署docker项目
运维·docker·容器