linux设置清华镜像源
时间: 2023-11-08 17:54:49 浏览: 109
可以通过以下步骤来设置清华镜像源:
1. 打开终端并输入以下命令:
```
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
2. 使用vim编辑器打开sources.list文件:
```
sudo vim /etc/apt/sources.list
```
3. 将以下内容复制并粘贴到sources.list文件中:
```
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
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
```
4. 保存并关闭文件。使用以下命令:
```
:wq
```
5. 更新软件包列表:
```
sudo apt-get update
```
现在,您的Linux系统已经成功设置了清华镜像源。
阅读全文