The conda pkgs folder is huge. Is it safe to delete?
~/miniconda3/pkgs~/anaconda3/pkgsYes, it's safe to clear, and the right method is one command: conda clean --all. The pkgs folder inside miniconda3 (or anaconda3) is conda's download cache, not your environments. Everything in it can be re-downloaded, and your environments keep working after a cleanup. After a few years of data science work it often holds several gigabytes, sometimes well past 10 GB.
What it is
When you run conda install or conda create, conda downloads any package it does not already have as an archive (a .conda or .tar.bz2 file) into the pkgs folder, extracts it there, and then links the files into the target environment. The point of the cache is speed: the second environment that needs numpy gets it from disk instead of the network. The folder sits at ~/miniconda3/pkgs on a Miniconda install and ~/anaconda3/pkgs on Anaconda. Same folder, same job.
It grows because conda never prunes it on its own. Every version of every package you have ever installed stays there, both as the compressed archive and as an extracted copy. Scientific Python stacks are heavy: PyTorch, TensorFlow, MKL, and their dependency trees run to hundreds of megabytes each, and a routine upgrade leaves the old version sitting in the cache forever. A machine that has been through a few projects and a few conda update cycles ends up with gigabytes of packages nothing references anymore.
Is it safe to delete?
Deleting it costs you nothing but bandwidth. Conda re-downloads any package the next time an environment actually needs it, so the worst case is a slower conda create next week. Your existing environments live in a separate envs folder and are not touched by clearing the cache. One quirk worth knowing: conda links files from pkgs into environments as hard links, so removing the cached copies does not break the environments that share them. It also means the space you get back can be less than the folder's listed size, because file data still used by an environment survives the delete.
The official command is the better route because it is selective: conda clean --all removes downloaded archives, extracted packages no environment links to anymore, and stale index caches, and it leaves conda's own bookkeeping in a state it expects. Diskmack identifies this folder automatically and cleans it the safe way. Either route works; the command is just tidier.
How to check its size
In Finder: In Finder, choose Go > Go to Folder (Shift+Cmd+G), enter ~/miniconda3 (or ~/anaconda3 if you installed Anaconda), press Return, then select the pkgs folder and press Cmd+I to see its size.
In Terminal:
du -sh ~/miniconda3/pkgs ~/anaconda3/pkgs 2>/dev/nullThe ~ is your home folder; whichever install you have prints its size.
How to clean it
- Quit Jupyter, any running Python work, and any terminal that is in the middle of a conda install.
- In Finder, choose Go > Go to Folder and enter ~/miniconda3/pkgs (use ~/anaconda3/pkgs if you installed Anaconda).
- Press Cmd+A to select everything inside, then press Cmd+Delete to move it all to the Trash. Keep the pkgs folder itself in place.
- Empty the Trash to actually free the space, then re-check the size if you're curious.
The official way: this tool ships its own cleanup command, which handles locks and indexes correctly.
conda clean --allPrefer the command when you can. It skips files your environments still hard-link and clears conda's index caches at the same time. If conda itself is broken or half uninstalled, the Finder route is fine.
Will it come back?
Yes, and that is by design. Every conda install, conda create, and conda update refills the cache with whatever it downloads. How fast it regrows tracks how much you use conda: a heavy ML setup can be back to multiple gigabytes within a few weeks, while an occasional-use machine might take a year. There is no setting to cap the cache size, so the realistic play is to run conda clean --all every few months, or whenever the disk-space warning shows up.
Common questions
Will deleting pkgs break my existing conda environments?
No. Environments live under envs (for example ~/miniconda3/envs) and hold their own hard links to the package files. Deleting the cache entries does not remove the underlying data those links point to, so existing environments keep working. New installs just re-download.
What's the difference between conda clean --all and deleting the folder in Finder?
Both are safe, but not identical. conda clean is selective: it keeps extracted packages your environments still hard-link and updates conda's own records, so installing one of those packages into a new environment stays instant. Finder deletion empties the whole cache, so the next environment that wants any package triggers a fresh download. conda treats a missing cache as empty and carries on.
My conda lives in /opt/anaconda3 or /opt/miniconda3. Does the same advice apply?
Yes. The pkgs folder plays the same role wherever conda was installed; adjust the paths in the commands to match. For installs under /opt you may need administrator rights to delete files by hand, which is another reason to let conda clean do it.
Does conda clean --all touch my envs folder?
No. It only prunes caches: package archives, extracted packages that nothing links to, and index caches. Your environments and the packages they actually use stay put.
Related folders
- How to Clear the pip Cache on Your Mac (and Why It's Safe to Delete)
- Is It Safe to Delete the uv Cache (~/.cache/uv) on a Mac?
- Can I Delete the venv Folder? Yes, With One Check First
- Is the Hugging Face cache safe to delete? What's inside ~/.cache/huggingface
- Can I delete __pycache__? Yes, it's safe on every Mac