Skip to main content

Command referenceconda clean

conda clean command (Linux & Windows / Conda)

Linux & WindowsCondapackageintermediateDestructive — use carefully

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 / optionMeaning
-a, --allRemove index cache, lock files, unused packages, and tarballs.
-p, --packagesRemove unused packages from writable package caches.
-t, --tarballsRemove cached package tarballs.
-i, --index-cacheRemove the index cache.
-y, --yesDo not ask for confirmation.
-d, --dry-runShow 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.

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.