Skip to content

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.

4 min read

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
FolderHolds
packagesPackage source code, every version used
artifactsBinary dependencies, often the largest
compiledPrecompiled caches per Julia version
juliaupInstalled Julia versions
registriesPackage 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.

Read next