ubuntu20.04更换国内源 apt
时间: 2023-10-11 20:06:04 浏览: 137
您好!要在Ubuntu 20.04更换为国内的软件源,可以按照以下步骤操作:
1. 打开终端,可以使用快捷键Ctrl+Alt+T。
2. 备份当前的软件源列表,以防出现问题:
```
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
```
3. 编辑软件源列表文件:
```
sudo nano /etc/apt/sources.list
```
4. 在打开的文件中,将原有的内容全部删除,然后将下面的内容粘贴进去:
对于阿里云源:
```
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# deb-src http://archive.ubuntu.com/ubuntu focal main restricted #Added by software-properties
# 阿里云源
deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
## Not recommended
# deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
阅读全文