The ~/.julia folder keeps every package version, artifact and compiled cache
Julia stores packages, binary artifacts and precompiled code in ~/.julia, and old versions stay until garbage collected. How to measure and trim it.
Julia keeps everything in its depot, ~/.julia. Package versions, large binary artifacts, precompiled caches for each Julia version, and Julia versions themselves if you use juliaup. Old versions stay until you ask Julia to clean up.
du -sh ~/.julia
du -sh ~/.julia/* 2>/dev/null | sort -h| Folder | Holds |
|---|---|
packages | Package source code, every version used |
artifacts | Binary dependencies, often the largest |
compiled | Precompiled caches per Julia version |
juliaup | Installed Julia versions |
registries | Package registry |
Clean up
julia -e 'using Pkg; Pkg.gc()'This removes package versions and artifacts no environment uses. Then remove precompile caches for Julia versions you no longer have from ~/.julia/compiled, and old Julia versions with juliaup remove.
Related: Jupyter and datasets, Mac storage for data scientists.
Common questions
Where does Julia store packages on a Mac?
In the depot at ~/.julia, in packages, artifacts and compiled folders.
How do I clean up old Julia packages?
Run julia -e 'using Pkg; Pkg.gc()' to remove versions and artifacts no environment uses.
Can I delete ~/.julia/compiled?
Yes. Julia precompiles again when packages are next loaded, which is slower the first time.