Uninstalling Anaconda Distribution removes a large user-owned Python stack, so the first decision is whether project environments and shared Conda settings should survive. A complete cleanup backs up anything needed later, removes the base prefix with Anaconda's uninstaller, and verifies that new shells no longer find conda.
Current macOS and Linux Anaconda installers include an uninstall.sh script in the base prefix. The script removes packages from the prefix and can also remove caches, user config files, and user data when given cleanup flags. Windows installs should be removed with the Windows Anaconda uninstaller instead of these terminal commands.
The cleanup flags can remove home-directory files that another Conda installation still uses. Keep ~/.condarc, ~/.conda, or external environment directories when they belong to another Anaconda, Miniconda, Mambaforge, or shared workstation setup.
Related: Install Anaconda on Ubuntu or Debian
Related: Install Miniconda
Steps to uninstall Anaconda Distribution on macOS or Linux:
- Open a terminal that can still run conda.
- Export any environment that must be recreated later.
$ conda env export --name analysis > analysis.yml
Repeat the export for each named environment that should survive the uninstall.
Related: Export a Conda environment to YAML - List Conda environments and identify anything outside the Anaconda base directory.
$ conda info --envs # conda environments: # base * /home/user/anaconda3 analysis /home/user/anaconda3/envs/analysis gpu /srv/conda/envs/gpu
Directories outside the base prefix are not removed by deleting /home/user/anaconda3. Remove only the external environment directories that no other user or Conda installation needs.
- Find the Anaconda base directory.
$ conda info --base /home/user/anaconda3
- Leave the active base environment.
$ conda deactivate
No output is normal. The terminal prompt should no longer start with (base).
- Run the Anaconda uninstaller from the base directory.
$ ~/anaconda3/uninstall.sh --yes --remove-caches --remove-config-files user --remove-user-data Uninstalling conda installation in /home/user/anaconda3... Running conda init --reverse... No action taken. Removing environments... ##### snipped ##### Cleaning cache directories. Removing .condarc files... Removing user data...
The --remove-config-files user and --remove-user-data flags remove home-directory Conda settings and data. Omit them when another Conda installation still uses those files. If conda info –base points to /opt/anaconda3 or another root-owned path, run the same command with that exact path through sudo -E. If uninstall.sh is missing, the installation was probably created with an older Anaconda Distribution installer and needs the manual removal path from Anaconda's uninstall documentation.
- Confirm the install directory is gone.
$ test ! -d ~/anaconda3 && echo "Anaconda installation directory removed" Anaconda installation directory removed
Replace ~/anaconda3 with the base path printed earlier when the installation used a different directory.
- Open a new terminal.
- Verify conda is no longer on PATH.
$ conda --version bash: conda: command not found
If this prints another Conda version, another installation is still on PATH. Run conda info –base before removing anything else.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.