Common Software Cache Cleaning Methods

Table of Contents

Manually

It is safe to delete items in the cache directory manually though doing so does degrade performance.  It's recommended it be done selectively.  The following command will show you the largest to smallest directories in sorted order:

du ~/.cache -a -h -d 1 | sort -h -r

python

pip

python -m pip cache purge

Hugging Face

Hugging Face's cache directory is located at : ~/.cache/huggingface/

Hugging Face has several options for managing its cache, such as deleting the cache programmatically and/or limiting its maximum size.  See: https://huggingface.co/docs/datasets/en/cache

micromamba

mamba clean -a	

conda

conda clean -a

R

Matlab

  • Cache Location: ~/.matlab

Nextflow

  • Cache Location: ~/.nextflow

javascript

npm

npm cache clean --force

Tools

apptainer

For all options view:

apptainer cache clean --help

singularity

For all options view:

singularity cache clean --help