Linux安装Mamba 并 配置环境变量

17 篇文章 0 订阅

一 下载

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]$ "

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值