# Is it safe to delete conda’s pkgs folder and old environments?

Is it safe to delete? · Package caches · Updated 21 November 2026. By Mohit Nippanikar, who makes SiftMac.

## The short answer

- **Yes, through conda.** `conda clean --all` removes cached packages no environment uses, along with tarballs, index caches and logs. Deleting `pkgs` by hand can break environments that link back to it, so don’t.
- **What it costs you:** a package removed from the cache downloads again the next time an environment needs it.
- **Does it come back?** The cache refills as you install. Environments are different: one you remove is gone unless you exported it first.
- SiftMac’s verdict: Rebuilds

## 1. What pkgs and envs hold

conda downloads each package as an archive, unpacks it into its package cache, `pkgs`, and then links the files into every environment that uses it. When the cache and the environments are on the same disk, those are hard links: one file on disk with two names. A package shared by five environments takes its space once.

- `pkgs`: downloaded archives (tarballs) and unpacked packages, including old versions left behind by updates, plus conda’s index cache.
- `envs`: one folder per named environment, each a full Python or R installation with its packages.

Updates and new environments keep adding to `pkgs`; `conda clean` is how it shrinks.

## 2. Where they are

Both sit inside conda’s base folder, which depends on how you installed it. Miniconda’s command-line installer proposes `~/miniconda3`, its graphical installer uses `/opt/miniconda3`, and Miniforge and Anaconda use their own folders. Ask conda:

```
conda info --base
conda config --show pkgs_dirs envs_dirs
conda env list
```

## 3. How big they are, without counting twice

Because environments and `pkgs` share hard-linked files, measuring `pkgs` alone counts every package in full, including those no cleanup would remove. Measure the whole base folder for the real total, `pkgs` for an upper bound, and let conda tell you what a clean would free:

```
du -sh "$(conda info --base)"
du -sh "$(conda info --base)/pkgs"
conda clean --all --dry-run
```

The dry run lists exactly what `conda clean --all` would delete, so it’s the honest number.

## 4. How to clear it

1. Close Jupyter, editors and terminals that are using a conda environment.
2. Preview, then clean. `conda clean --all` removes the index cache, unused cached packages, tarballs, temporary files and log files.
3. Leave out `--force-pkgs-dirs` (`-f`). It isn’t part of `--all`: it removes every writable package cache, and conda’s docs warn it breaks environments installed with symlinks back to that cache.

```
conda clean --all --dry-run
conda clean --all
```

conda only checks environments it knows about. Ones that `conda info --envs` doesn’t list aren’t checked for links back to the cache, so make sure yours show up before cleaning.

### Old environments

Environments are yours: conda can’t rebuild one unless you saved what was in it. For each one you might want again, export it, then remove it:

```
conda env export --name old-env --from-history > old-env.yml
conda remove --name old-env --all
```

`--from-history` saves only the packages you asked for, which makes a file that works across platforms. To bring it back later, conda’s docs recommend `conda create --file old-env.yml`; the older `conda env create --file old-env.yml` still works. After removing environments, run `conda clean --all` again, since packages only they used are now unused.

## 5. What happens afterwards

- Environments you kept work as before: conda only removed packages none of them use.
- Installing a package or creating an environment that needs something you cleaned out downloads it again, so that install is slower and needs the network.
- A removed environment is gone. Its YAML file recreates it, with fresh downloads.
- Jupyter kernels or editor settings that pointed at a removed environment need pointing somewhere else.

## Questions

### Will conda clean --all break my environments?

No. It removes packages no environment uses, plus archives, caches and logs. The option that can break environments, `--force-pkgs-dirs`, isn’t included in `--all`.

### Why did conda clean free less than the size of pkgs?

Most of `pkgs` is shared with your environments through hard links. Those files stay because environments still use them; only packages no environment links to are removed.

### Can I just delete the pkgs folder in Finder?

Don’t. Environments installed with symlinks back to the cache stop working, and conda loses track of what it has. `conda clean` does the job safely.

### What’s the difference between --packages and --tarballs?

`--tarballs` removes only the downloaded archives; `--packages` removes unpacked packages that no environment uses. `--all` includes both.

## How SiftMac handles it

SiftMac leaves conda’s folders to conda: it doesn’t clear `pkgs` or remove environments, because only conda knows which packages its environments share. Its space map can show how big the conda folder and each environment in it are, so you can see which ones to export and remove.

Download: https://siftmac.com/SiftMac.dmg (scanning is free, and so is the first 2 GB of cleaning).

## Sources

- [conda docs: conda clean](https://docs.conda.io/projects/conda/en/stable/commands/clean.html)
- [conda docs: Managing environments](https://docs.conda.io/projects/conda/en/stable/user-guide/tasks/manage-environments.html)
- [conda docs: custom locations for environments and the package cache](https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/custom-env-and-pkg-locations.html)
- [Anaconda: installing Miniconda on macOS from the command line](https://www.anaconda.com/docs/getting-started/miniconda/install/mac-cli-install)
- [Anaconda: installing Miniconda on macOS with the graphical installer](https://www.anaconda.com/docs/getting-started/miniconda/install/mac-gui-install)

## Related

- [Is it safe to delete ~/Library/Caches/pip?](https://siftmac.com/safe-to-delete/pip-cache)
- [Is it safe to delete a Python virtual environment (.venv)?](https://siftmac.com/safe-to-delete/python-venv)
- [Is it safe to delete uv’s cache?](https://siftmac.com/safe-to-delete/uv-cache)
- [What fills a data scientist’s Mac: environments, caches and datasets](https://siftmac.com/for/data-scientists)
- [Xcode DerivedData, node_modules and Docker: what’s safe to delete on a developer’s Mac](https://siftmac.com/guides/developer-files-on-mac)

Canonical: https://siftmac.com/safe-to-delete/conda-packages
