python配置清华源
时间: 2023-11-20 11:50:37 浏览: 151
Anaconda虚拟python3.6+tensorflow2.1环境压缩包、.condarc配置文件(内有清华镜像源)
5星 · 资源好评率100%
好的,以下是配置清华源的步骤:
1. 打开终端,输入以下命令进入源列表目录:
```
cd /etc/apt/sources.list.d/
```
2. 备份原有的源列表文件:
```
sudo cp ./ubuntu.list ./ubuntu.list.bak
```
3. 编辑 ubuntu.list 文件,将原有的内容全部注释掉,然后添加以下内容:
```
# 清华大学 TUNA 镜像源
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. 更新源列表:
```
sudo apt-get update
```
5. 配置完成。
阅读全文