Linux 环境删除Conda
你可以按照以下步骤操作来删除Conda:
-
首先,停止所有conda环境。在终端中运行以下命令:
conda deactivate
-
然后使用以下命令获取conda安装的路径:
which conda
如果成功安装了conda,该命令输出的路径应该是类似于这样的:
/path/to/conda/bin/conda
-
接下来,卸载conda。使用以下命令:
/path/to/conda/bin/conda install anaconda-clean
这将安装anaconda-clean程序,该程序可以轻松地卸载conda。
-
安装完成后,运行以下命令:
anaconda-clean
这将提示您输入“yes”以确认卸载conda。
-
一旦卸载完成,您需要从
.bashrc
文件中删除conda路径。运行以下命令:nano ~/.bashrc
删除以下行:
export PATH="/path/to/conda/bin:$PATH"
这里的
/path/to/conda
应该是您在第2步中获取的conda安装路径。 -
保存并关闭文件。重新加载配置文件以使更改生效:
source ~/.bashrc
现在,您已经成功地从centos系统中删除了Conda。
root@bogon:/home/test# conda --version
conda 4.8.2
root@bogon:/home/test#
root@bogon:/home/test# conda deactivate
root@bogon:/home/test#
root@bogon:/home/test# which conda
/root/anaconda3/condabin/conda
root@bogon:/home/test# /path/to/conda/bin/conda install anaconda-clean
-bash: /path/to/conda/bin/conda: No such file or directory
root@bogon:/home/test# /root/anaconda3/condabin/conda install anaconda-clean
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
'https://repo.anaconda.com/pkgs/main/linux-64'
root@bogon:/home/test#