Created
February 28, 2020 15:32
-
-
Save johnnychen94/059628dff2eb26688fa3de2f236e9fbb to your computer and use it in GitHub Desktop.
download&install anaconda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# 设置版本及下载源 | |
CONDA_VERSION=2019.10 | |
CONDA_NAME=Anaconda3-${CONDA_VERSION}-Linux-x86_64.sh | |
CONDA_URL=https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/$CONDA_NAME | |
# 下载并安装anaconda | |
echo "Download anaconda from ${CONDA_URL}" | |
curl -O $CONDA_URL | |
mkdir -p $HOME/local | |
bash $CONDA_NAME -fb -p $HOME/local/anaconda3 | |
rm -f $CONDA_NAME | |
# 添加conda path | |
if [[ -z `grep local/anaconda3/bin ~/.bashrc` ]]; then | |
printf '# \nAdded by anaconda3 installation script\n' | tee -a ~/.bashrc | |
echo '# https://gitlab.lflab.cn/snippets/16' | tee -a ~/.bashrc | |
echo 'export PATH="$HOME/local/anaconda3/bin:$PATH"' | tee -a ~/.bashrc | |
source ~/.bashrc | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment