下载 anaconda

官网

https://repo.anaconda.com/archive/

国内镜像

https://mirrors.bfsu.edu.cn/anaconda/archive/

https://mirrors.xjtu.edu.cn/anaconda/archive/

https://mirror.bjtu.edu.cn/anaconda/archive/

https://mirrors.hit.edu.cn/anaconda/archive/

https://mirrors.aliyun.com/anaconda/archive/?spm=a2c6h.25603864.0.0.2da34eb925S2Ym

# 以清华源的Anaconda3-2022.10-Linux-x86_64展示wget https://mirrors.bfsu.edu.cn/anaconda/archive/Anaconda3-2022.10-Linux-x86_64.sh

安装 anaconda

sudo sh Anaconda3-2022.10-Linux-x86_64.sh# Please, press ENTER to continue -> 回车继续# Do you accept the license terms? [yes|no] -> 同意协议输入yes回车# 待安装结束

变量环境普通用户

sudo vim  ~/.bashrc# 下面的添加到bashrc文件的末尾添加# anaconda环境export PATH=/home/ahtelek/anaconda3/bin:$PATH

超级用户

sudo vim /etc/profile# 下面的添加到profile文件的末尾添加# anaconda环境export PATH=/home/ahtelek/anaconda3/bin:$PATH
sudo vim /root/.bashrc# 在文件的末尾添加source /etc/profile

配置生效

source ~/.bashrcsource /root/.bashrc

配置国内源普通用户

conda config --set show_channel_urls yesvim ~/.condarc# 复制到.condarc文件channels:  - defaultsshow_channel_urls: truedefault_channels:  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2custom_channels:  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

超级用户

sudo suconda config --set show_channel_urls yesvim ~/.condarc# 复制到.condarc文件channels:  - defaultsshow_channel_urls: truedefault_channels:  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2custom_channels:  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

测试

# 清除索引缓存conda clean -iconda create -n name

参考资料

  • https://www.jianshu.com/p/e39cb192bde0
  • https://mirror.nju.edu.cn/help/anaconda
  • https://mirrors.pku.edu.cn/Help/Anaconda
  • https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
  • https://mirrors.bfsu.edu.cn/help/anaconda/

本文来自博客园,作者:Ahtelek·B,转载请注明原文链接:https://www.cnblogs.com/AhtelekB/p/ubuntu-install-anaconda.html