ubuntu20.04换源
时间: 2023-09-26 22:11:46 浏览: 166
Ubuntu 20.04换阿里源的方法
以下是在Ubuntu 20.04上更改软件源的步骤:
1. 打开终端,输入以下命令备份原来的源:
```
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
2. 编辑源文件:
```
sudo nano /etc/apt/sources.list
```
3. 将文件中的内容删除,并复制以下内容:
```
##阿里云镜像源
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
```
4. 保存并关闭文件。
5. 更新软件源:
```
sudo apt-get update
```
6. 更新系统:
```
sudo apt-get upgrade
```
7. 完成。
注意:如果您不想使用阿里云镜像源,可以将上述内容中的阿里云地址替换为其他可用的源地址。
阅读全文