ubuntu20.04.1更换国内源
时间: 2023-10-06 15:08:59 浏览: 114
Ubuntu 20.04.4升级20.04.6离线资源包
更换ubuntu20.04.1的国内源的步骤如下:
1. 打开终端。
2. 输入以下命令备份原来的源文件:
```
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
3. 使用文本编辑器打开源文件:
```
sudo nano /etc/apt/sources.list
```
4. 将源文件中的内容替换为以下内容(可以根据需要选择合适的国内源):
```
# 默认注释了源码仓库,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src 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-src 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-src 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-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
```
5. 按下Ctrl + X,然后按Y保存更改。
6. 运行以下命令更新软件包列表:
```
sudo apt update
```
阅读全文