一 下载
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh
# or
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh
# Uninstall 以下内容来自官网
# https://github.com/conda-forge/miniforge
Uninstalling Miniforge means removing the files that were created during the installation process. You will typically want to remove:
Any modifications to your shell rc files that were made by Miniforge:
# Use this first command to see what rc files will be updated
conda init --reverse --dry-run
# Use this next command to take action on the rc files listed above
conda init --reverse
# Temporarily IGNORE the shell message
# 'For changes to take effect, close and re-open your current shell.',
# and CLOSE THE SHELL ONLY AFTER the 3rd step below is completed.
Remove the folder and all subfolders where the base environment for Miniforge was installed:
CONDA_BASE_ENVIRONMENT=$(conda info --base)
echo The next command will delete all files in ${CONDA_BASE_ENVIRONMENT}
# Warning, the rm command below is irreversible!
# check the output of the echo command above
# To make sure you are deleting the correct directory
rm -rf ${CONDA_BASE_ENVIRONMENT}
二 环境变量
如果是在自己的HOME目录下一般是不需要这步,直接配置~/.bashrc
ln -s /home/woodman/miniforge3/bin/mamba /home/woodman/anaconda3/bin/mamba
cat ~/.bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
if [ -f /home/woodman/.bash_aliases ]; then
. /home/woodman/.bash_aliases
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rc
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/woodman/miniforge3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/woodman/miniforge3/etc/profile.d/conda.sh" ]; then
. "/home/woodman/miniforge3/etc/profile.d/conda.sh"
else
export PATH="/home/woodman/miniforge3/bin:$PATH"
fi
fi
unset __conda_setup
if [ -f "/home/woodman/miniforge3/etc/profile.d/mamba.sh" ]; then
. "/home/woodman/miniforge3/etc/profile.d/mamba.sh"
fi
# <<< conda initialize <<<
source /home/woodman/anaconda3/bin/activate
conda deactivate
conda deactivate
# TIME
export LC_TIME='en_US.UTF-8'
export PS1="[\W]$ "