Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does conda clean remove packages from?

Tags:

conda

The conda documentation specifies:

conda clean [-h] [-y] [--dry-run] [--json] [--debug] [--verbose] [-q] [-a] [-i] [-l] [-t] [-p] [-s]

Remove unused packages and caches.

Example:

conda clean --tarballs 

(conda clean documentation)

So it is supose to remove unused packages.

where from ?

  • from conda (base) ?
  • from the active environment ?

Does the environment need to be active?

How does it know they are unused packages?

like image 361
jalazbe Avatar asked Aug 22 '18 05:08

jalazbe


People also ask

What does conda clean -- Packages do?

Remove index cache, lock files, unused cache packages, and tarballs.

Is it safe to use conda clean?

Conda documentation says that it it's safe to do that, as it will only erase packages that "have never been used in any environment".

How do I clean my Anaconda cache?

We can try going into the 'pkgs' directory and manually clean them up. Or, we can go the easy way, by using the 'conda clean' command. This will clean the index cache, lock files, tarballs, unused cache packages, and the source cache.


1 Answers

It removes unused packages from under the pkgs/ directory wherever you happen to have conda installed. An "unused" package is one that's not used in any environment. All conda packages are stored under the pkgs/ directory and then hard-linked (if possible) into the environments.

As an aside, conda clean will print out the location of where the packages are actually located:

$ conda clean -all Cache location: /data/processing/ryan/miniconda/pkgs Will remove the following tarballs:  /data/processing/ryan/miniconda/pkgs ------------------------------------ filelock-3.0.10-py_0.tar.bz2                   9 KB 

Edit 13.3.2020 rvf pointed out that the -all option has been changed to -a or --all in conda 4.8.2.

like image 119
Devon Ryan Avatar answered Sep 18 '22 10:09

Devon Ryan