189 words
1 minute
Conda

I. Conda Cache Cleanup — Free Up Disk Space
Overview: Conda accumulates downloaded packages, extracted tarballs, and index caches over time. Cleaning these up frees disk space and reduces environment cruft — without touching any of your existing environments.
1. Check Conda Cache Usage (Optional)
conda infoconda config --show pkgs_dirsdu -sh ~/miniconda3/pkgs 2>/dev/null2. One-command Cache Cleanup (Recommended)
conda clean -a -y| Flag | Meaning |
|---|---|
-a | all — cleans every type of cache and leftover |
-y | yes — auto-confirms without prompting |
This removes:
- Downloaded
.tar.bz2/.condapackage archives - Extracted package caches
- Index caches
- Unused package caches
3. Also Clean pip Cache (If Used Inside Conda Envs)
pip cache purge4. Verify the Space Was Freed (Optional)
du -sh ~/miniconda3/pkgs 2>/dev/nullNote:
conda clean -a does not delete your environments — it only removes cached downloads. The trade-off is that the next time you install a package, conda may need to re-download it.💡 One-line Takeaway
Run
Run
conda clean -a -y to safely reclaim disk space from package caches — your environments stay completely intact.