Ubuntu卸载Anaconda步骤

1 进行相关文件的删除(删除12个文件夹)

  1. 删除anaconda3文件夹
rm -rf ~/anaconda3
  1. 删除.anaconda文件夹
rm -rf ~/.anaconda
  1. 删除.condarc文件夹
rm -rf ~/.condarc 
  1. 删除.conda文件夹
rm -rf ~/.conda 
  1. 删除.continuum文件夹
rm -rf ~/.continuum
  1. 删除.ipython文件夹
rm -rf ~/.ipython
  1. 删除/.local/share/jupyter
rm -rf ~/.local/share/jupyter
  1. 删除/.local/share/Spyder
rm -rf ~/.local/share/Spyder
  1. 删除/.config/spyder-py3
rm -rf ~/.config/spyder-py3
  1. 删除/.jupyter文件夹
rm -rf ~/.jupyter
  1. 删除/.ipynb_checkpoints文件夹
rm -rf ~/.ipynb_checkpoints
  1. 删除/.keras文件夹
rm -rf ~/.keras

2、删除Anaconda·配置的环境变量

2.1 打开/.bashrc文件

sudo gedit ~/.bashrc

2.2 编辑/.bashrc内容

2.2.1 情况一

删除 包含 # >>> conda initialize >>>与# <<< conda initialize <<<以及两者之间的所有内容
,例如我的是删除

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/alice/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/alice/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/alice/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/alice/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

2.2.2 情况二

如果末尾有自己添加的anaconda路径内容,也要删除
将末尾的此行删除

# added by Anaconda3 installer
export PATH="/home/alice/anaconda3/bin:$PATH"

此处的alice应为你的实际用户名

2.3 更新环境变量,使更改生效

命令如下:

source ~/.bashrc

至此,anaconda已经完全被卸载 此后,可进行Anaconda的重新安装了

你可能感兴趣的:(ubuntu,bash,linux,python,anaconda)