Easily and completely uninstall Anaconda, Miniconda, Mambaforge, Miniforge, or Micromamba from macOS, Linux, and Windows.
When you uninstall Conda via normal means, traces often remain in:
- Shell configuration files (
.zshrc,.bashrc, etc.) - System profile scripts
- Homebrew casks (macOS)
- Hidden configuration folders
- PATH variables
- Fish shell configs
Conda-Purger automates the process of finding and removing all those remnants, with a safe dry-run by default so you can review changes before applying them.
- β Cross-platform: macOS, Linux, and Windows
- β
Removes:
- Anaconda, Miniconda, Mambaforge, Miniforge
- Micromamba (optional)
- β
Cleans:
- Shell startup files (Zsh, Bash, Fish, Csh, Tcsh)
- System
/etc/profile.dscripts - Homebrew installations
- Hidden Conda config/cache folders
- β Dry-run mode (default) β see what would be removed before deleting
- β JSON output option for scripting/integration
- β
Optional
--forceto continue even if some steps fail
- Bash or Zsh (pre-installed)
- (Optional) Homebrew if you want to remove Homebrew-installed Conda
- Bash (pre-installed on most distros)
sudoaccess for removing system profile scripts
- PowerShell 5+ (Windows 10+ includes it by default)
You can run it directly from the repository without installing anything globally.
git clone https://github.com/mocha06/Conda-Purger.git
cd Conda-PurgerFrom the repository root, use the dispatcher script:
# Dry-run (default)
./scripts/purge_conda_macos.sh
# Actually remove everything
./scripts/purge_conda_macos.sh --yes
# Full cleanup including Miniforge/Mambaforge & Micromamba
./scripts/purge_conda_macos.sh --yes --include-forge --include-micromamba# macOS
./scripts/purge_conda_macos.sh --yes --include-forge --include-micromamba
# Linux
./scripts/purge_conda_linux.sh --yes --include-forge --include-micromambaFrom Windows PowerShell (not WSL):
# Dry-run
.\scripts\Purge-CondaWindows.ps1
# Actually remove everything
.\scripts\Purge-CondaWindows.ps1 -Yes -IncludeForge -IncludeMicromamba
# With JSON output
.\scripts\Purge-CondaWindows.ps1 -Yes -Json | ConvertFrom-Json | Format-ListOr from Git Bash / WSL:
./scripts/purge_conda_linux.sh --yes(WSL mode cleans the Linux environment only.)
| Flag | macOS/Linux | Windows PowerShell | Description |
|---|---|---|---|
--yes |
--yes |
-Yes |
Actually perform deletions |
--force |
--force |
-Force |
Continue even if a removal fails |
--quiet |
--quiet |
-Quiet |
Suppress non-error output |
--json |
--json |
-Json |
Output changes in JSON format |
--include-forge |
--include-forge |
-IncludeForge |
Also remove Mambaforge/Miniforge |
--include-micromamba |
--include-micromamba |
-IncludeMicromamba |
Also remove Micromamba |
--system |
(not implemented) | -System |
On Windows, clean for all system users |
- Dry-run is ON by default β no changes are made until you add
--yes(or-Yesin PowerShell). - The script makes backups of shell configuration files before modifying them.
- On macOS/Linux,
--forceskips aborting on permission errors (e.g.,/etc/profile.d). - Always review the dry-run output carefully before running with
--yes.
./scripts/purge_conda_macos.sh./scripts/purge_conda_macos.sh --yes --include-forge --include-micromamba.\scripts\Purge-CondaWindows.ps1 -Yes -IncludeForge -IncludeMicromamba -System./scripts/purge_conda_macos.sh --yes --jsonIf you get permission errors on macOS/Linux:
# Make scripts executable
chmod +x scripts/purge_conda_macos.sh
chmod +x scripts/purge_conda_linux.shIf PowerShell blocks script execution:
# Allow execution for current session
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope ProcessIf you're using WSL, the Linux script will clean your Linux environment. To clean Windows:
- Open Windows PowerShell (not WSL)
- Navigate to the repository
- Run the Windows PowerShell script
- This will permanently delete Conda installations and related configuration files.
- Review the dry-run output carefully before running with
--yes. - The Windows PowerShell script is not totally tested, due to my limited knowledge of PowerShell and was mostly written by ChatGPT based on the Linux and Mac scripts. Use at your own risk. Feel free to submit a PR if you find any issues.
Contributions are welcome! Please feel free to submit a PR if you find any issues. To test your changes and ensure they work as expected, you can run the tests in the tests directory. See the tests README for more details.
MIT (do whatever, just don't hold me liable)