What is the conda pkgs folder? Is it safe to delete?
Yes, the conda package cache is safe to clean. Use conda clean, which removes downloaded archives and packages that no environment uses. Do not delete the pkgs folder by hand, because your environments link to files inside it.
Where it is
~/miniconda3/pkgs (or ~/anaconda3/pkgs)What it is
Every time conda installs a package, it first downloads an archive and unpacks it into a pkgs folder inside the conda installation, for example ~/miniconda3/pkgs or ~/anaconda3/pkgs. Miniforge and other installers use the same layout under their own folder.
Environments are then built by linking to the unpacked files instead of copying them. This is why several environments with the same packages take less space than you would expect, and why removing the folder by hand can break them.
The cache grows with every package version you have ever installed. Updating an environment leaves the old versions in the cache.
How big it gets
Often several GB, and more than ten GB if you work with large scientific or machine learning packages.
How to clear it by hand
- Run conda clean --all --dry-run first. It lists what would be removed without removing anything.
- Run the command below. It deletes downloaded package archives, the index cache and unpacked packages that no environment links to, and asks for confirmation.
- To free more space, list your environments with conda env list and remove the ones you no longer need with conda env remove -n followed by the name.
- Run conda clean --all again after removing environments, since their packages are now unused.
conda clean --allWhat happens afterwards
Existing environments keep working. The next time you install or update a package that was removed from the cache, conda downloads it again.
How Diskzy handles it
Diskzy shows the conda folder on the disk map, with pkgs and each environment sized separately, so you can see whether the cache or old environments are taking the space.
Related guides
See where your Mac's space went
Diskzy maps your disk, explains System Data and clears what's safe. Free for 72 hours, then $9 once for 2 Macs.
Try Diskzy for free