Skip to content

mocha06/Conda-Purger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧹 Conda-Purger

Easily and completely uninstall Anaconda, Miniconda, Mambaforge, Miniforge, or Micromamba from macOS, Linux, and Windows.


πŸ“– Overview

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.


✨ Features

  • βœ… 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.d scripts
    • 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 --force to continue even if some steps fail

πŸ“‹ Requirements

macOS

  • Bash or Zsh (pre-installed)
  • (Optional) Homebrew if you want to remove Homebrew-installed Conda

Linux

  • Bash (pre-installed on most distros)
  • sudo access for removing system profile scripts

Windows

  • PowerShell 5+ (Windows 10+ includes it by default)

πŸš€ Installation

You can run it directly from the repository without installing anything globally.

git clone https://github.com/mocha06/Conda-Purger.git
cd Conda-Purger

πŸ“¦ Usage

Cross-Platform (Recommended)

From 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

Platform-Specific Scripts

macOS & Linux

# macOS
./scripts/purge_conda_macos.sh --yes --include-forge --include-micromamba

# Linux
./scripts/purge_conda_linux.sh --yes --include-forge --include-micromamba

Windows

From 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-List

Or from Git Bash / WSL:

./scripts/purge_conda_linux.sh --yes

(WSL mode cleans the Linux environment only.)


Options

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

πŸ›‘ Safety Notes

  • Dry-run is ON by default β€” no changes are made until you add --yes (or -Yes in PowerShell).
  • The script makes backups of shell configuration files before modifying them.
  • On macOS/Linux, --force skips aborting on permission errors (e.g., /etc/profile.d).
  • Always review the dry-run output carefully before running with --yes.

πŸ§‘β€πŸ’» Examples

Preview what would be removed:

./scripts/purge_conda_macos.sh

Full cleanup, including Miniforge/Mambaforge & Micromamba:

./scripts/purge_conda_macos.sh --yes --include-forge --include-micromamba

Windows, cleaning user + system:

.\scripts\Purge-CondaWindows.ps1 -Yes -IncludeForge -IncludeMicromamba -System

Get JSON summary of changes:

./scripts/purge_conda_macos.sh --yes --json

πŸ”§ Troubleshooting

Permission Issues

If you get permission errors on macOS/Linux:

# Make scripts executable
chmod +x scripts/purge_conda_macos.sh
chmod +x scripts/purge_conda_linux.sh

PowerShell Execution Policy

If PowerShell blocks script execution:

# Allow execution for current session
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process

WSL Users

If you're using WSL, the Linux script will clean your Linux environment. To clean Windows:

  1. Open Windows PowerShell (not WSL)
  2. Navigate to the repository
  3. Run the Windows PowerShell script

⚠️ Disclaimers

  • 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.

πŸ“ Contributing

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.

πŸ“ License

MIT (do whatever, just don't hold me liable)

About

No description, website, or topics provided.

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors