Conda Package Cache on Mac: Is It Safe to Clean?
Medium riskPackage managers & build toolsUpdated
- Location
~/.conda/pkgs
- Risk level
- Medium riskSafe to remove, but the tool that owns it re-downloads or rebuilds it on next use, which costs time and bandwidth. Listed, never pre-selected.
- Selected by default
- No — you choose whether to include it
- What Freshist does
- Moves the selected items to the Trash, so you can undo. Nothing is deleted outright.
- In the app
- Clean → Conda Package Cache — “Conda package cache — future installs re-download packages.”
From Freshist's own cleaning rules — the same catalog the app uses.
What lives in the package cache
Conda, the package and environment manager behind Anaconda, Miniconda and Miniforge, never installs straight from the internet into an environment. It downloads each package as a .conda or .tar.bz2 archive, extracts it into a package cache folder, then links files from there into every environment that needs it.
So a pkgs folder contains two copies of most things:
| Item | Example | Needed after install? |
|---|---|---|
| Archive | numpy-2.1.0-py312h...conda | No, only to re-extract |
| Extracted package folder | numpy-2.1.0-py312h.../ | Yes, if environments link to it with symlinks; otherwise only to create new environments fast |
cache/ | Repodata index downloaded from channels | No, refetched |
Where it is on a Mac
There is usually more than one cache. The conda configuration docs describe pkgs_dirs as a list, and by default the first writable entry is the pkgs folder inside your install, such as ~/miniconda3/pkgs, ~/anaconda3/pkgs or ~/miniforge3/pkgs. ~/.conda/pkgs is a per-user fallback, used when the install's own folder isn't writable (common with a shared or admin-owned install). Check which ones your setup really uses before cleaning anything.
Why it gets so large
Data science stacks are heavy. A single environment with PyTorch, SciPy and Jupyter, or the full Anaconda distribution, pulls in gigabytes of packages, and conda keeps both the archive and the extracted copy. Every conda update adds new versions without removing the old ones. After a few months of creating and deleting environments, the cache often holds versions no environment uses.
What happens if you clean it
conda clean is built to avoid breakage. According to the conda clean reference:
--tarballsremoves cached archives. Environments don't need them.--packagesremoves extracted packages no environment uses. It checks environments listed byconda info --envsfor symlinks; environments conda doesn't know about aren't checked.--allcombines tarballs, unused packages, the index cache, temp files and logs.--force-pkgs-dirsremoves the writable package caches entirely. It's not part of--all, and the docs warn it breaks environments installed with symlinks back to the cache.
Conda's default is hard links, which keep working when the cache copy disappears. That's why deleting by hand is usually survivable, but you can't tell from Finder which method a given environment used.
Find every package cache
conda info # look for "package cache" lines
conda config --show pkgs_dirs # cache folders in priority order
du -sh ~/miniconda3/pkgs ~/.conda/pkgs 2>/dev/null
conda clean --all --dry-run # what would be removed
Swap ~/miniconda3 for your install's path.
Clean it with conda
conda clean --all
Add -y to skip the confirmation prompt. If you use mamba, it has its own mamba clean command for the same caches; check mamba clean --help for its flags.
When a full cache helps
Keep the cache if you create environments often from the same packages: conda reuses extracted packages, so a new environment appears in seconds instead of minutes. Clean it after removing old environments, after a big update, or when the dry run shows gigabytes of tarballs. Python projects that use pip alongside conda have their own separate cache; for machine-learning downloads, see the Hugging Face cache and PyTorch cache guides.
Sources
Frequently asked questions
Why do I have more than one pkgs folder?
Conda checks a list of package caches. The usual first one is pkgs inside your installation (for example ~/miniconda3/pkgs); ~/.conda/pkgs is used when that location isn't writable or is listed in pkgs_dirs. conda config --show pkgs_dirs prints the list in order.
Does conda clean delete my environments?
No. Environments live in envs folders and are left alone. --packages only removes packages that no listed environment links to, and --all adds tarballs, the index cache and log files.
Should I use conda clean --force-pkgs-dirs to free the most space?
Only if you know your environments were created with hard links or copies. The conda docs warn it breaks environments installed with symlinks back to the package cache, which is why it is left out of --all.