How to uninstall Miniconda on Linux?

Felix Renard picture Felix Renard · Sep 14, 2017 · Viewed 11.9k times · Source

I have installed Miniconda in my Ubuntu Linux distribution. There is a conflict with the Python version of Linux. I would like to uninstall Miniconda. I follow the instruction in https://docs.anaconda.com/anaconda/install/uninstall.

$ anaconda-clean
Delete .conda? (y/n): y
Backup directory: /home/user1/.anaconda_backup/2017-09-14T221900
Error: Unable to move /home/user1/.conda
Delete .continuum? (y/n): y
Error: Unable to move /home/user1/.continuum

I have the Miniconda bin in the /usr/local/bin/miniconda. There is nothing in the folder /home/user1, and I cannot give some parameters to anaconda-clean.

How can I remove Miniconda properly? Remove directly the folder /usr/local/bin/miniconda?

Thanks!

Answer

Ratler picture Ratler · Dec 3, 2018

I'm wondering why you're getting those errors: are you actually using the user1 account or is there perhaps some other reason there would be an issue with permissions on those files?

In any case, to uninstall Miniconda from Ubuntu you need three things:

1. Remove configuration files

Even if it's not working properly, you could still use anaconda-clean to get an idea of which configuration files/directories are relevant (e.g., ".conda/", ".continuum/") and remove them manually.

2. Remove miniconda directory

Delete the Miniconda directory with rm -rf *directory_path* as was suggested in the comments.

3. Restore original .bashrc

Miniconda probably updated ~/.bashrc to add itself to PATH. It also probably made a backup of the original (something like ~/.bashrc-miniconda.bak), which you could simply restore; if not, you can manually remove the relevant line from .bashrc. It might look like one of the following:

export PATH="/home/user1/miniconda/bin:$PATH"
export PATH="/usr/local/bin/miniconda/bin:$PATH"