Skip to content

Instantly share code, notes, and snippets.

@johnnychen94
Created February 28, 2020 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnnychen94/059628dff2eb26688fa3de2f236e9fbb to your computer and use it in GitHub Desktop.
Save johnnychen94/059628dff2eb26688fa3de2f236e9fbb to your computer and use it in GitHub Desktop.
download&install anaconda
#! /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