ubuntu18.04anaconda换源
时间: 2023-11-14 08:10:03 浏览: 131
Anaconda换国内源
好的,针对您的问题,您可以按照以下步骤进行Ubuntu 18.04 Anaconda换源:
1. 打开终端,输入以下命令备份原有的源列表文件:
```
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
2. 打开源列表文件,使用文本编辑器打开 `/etc/apt/sources.list` 文件:
```
sudo nano /etc/apt/sources.list
```
3. 将原有的源地址替换为清华大学的镜像源地址,将以下内容复制到文件中:
```
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
```
4. 保存并退出文件,然后更新源列表:
```
sudo apt-get update
```
5. 安装 Anaconda:
```
bash ~/Downloads/Anaconda3-2021.05-Linux-x86_64.sh
```
6. 安装完成后,打开 `~/.bashrc` 文件:
```
nano ~/.bashrc
```
7. 在文件末尾添加以下内容:
```
# Anaconda
export PATH="/home/your_username/anaconda3/bin:$PATH"
```
8. 保存并退出文件,然后运行以下命令使修改生效:
```
source ~/.bashrc
```
阅读全文