Command referenceconda clean
conda clean command (Linux & Windows / Conda)
What it does
Remove unused Conda cache files, package tarballs, and temporary indices to free disk space. When people look up conda clean, they usually want safe flags, copyable examples, and how this Conda subcommand fits Anaconda or Miniconda workflows on Linux, Windows, and macOS. Syntax, options, and practical examples are below.
Remove unused Conda cache files, package tarballs, and temporary indices to free disk space.
Syntax
conda clean [options]
Common options
| Flag / option | Meaning |
|---|---|
| -a, --all | Remove index cache, lock files, unused packages, and tarballs. |
| -p, --packages | Remove unused packages from writable package caches. |
| -t, --tarballs | Remove cached package tarballs. |
| -i, --index-cache | Remove the index cache. |
| -y, --yes | Do not ask for confirmation. |
| -d, --dry-run | Show what would be removed. |
Practical examples
Preview cleanup
conda clean --all --dry-run
Reports reclaimable space without deleting anything.
Full cache clean
conda clean --all -y
Clears caches aggressively; next solves re-download indexes.
Tarballs only
conda clean -t
Deletes downloaded package archives but keeps extracted caches.
Unused packages
conda clean -p
Removes package caches not referenced by any environment.
Common mistakes
- Thinking `conda clean` deletes environments — it does not; use `conda env remove`.
- Running `--all` right before offline work when you still need cached tarballs.
Related commands
- conda env removeDelete a Conda environment and all packages installed inside it.
- conda removeUninstall one or more packages from a Conda environment (or remove an entire env with --all).
- conda infoShow Conda installation details, active environment, channels, and platform metadata.
- conda listList packages installed in the active or named Conda environment.
- conda createCreate a new isolated Conda environment with an optional Python version and starter packages.
- conda activateActivate a named or path-based Conda environment in the current shell session.
- conda installInstall packages into the active or named Conda environment from configured channels.
- conda env listList all Conda environments and mark the currently active one.
FAQ
What does conda clean do in Conda?
Remove unused Conda cache files, package tarballs, and temporary indices to free disk space.
Does conda clean work on Windows and Linux?
Yes. Conda runs on Linux, Windows, and macOS; shell activation differs slightly after `conda init`, but the CLI flags are the same.
What is a practical conda clean example?
Try `conda clean --all --dry-run` — Reports reclaimable space without deleting anything.
Is mamba the same as conda clean?
Mamba is a faster drop-in solver for many Conda workflows. Prefer `mamba` only when it is installed; otherwise use the Conda commands on this page.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.