How to cleanup artifacts folder

I recently noticed that my home folder is occupying 89% of my SSD because of .julia/artifacts:

How to clean up this folder and start fresh? I just want to keep the global environments I’ve defined and the dev’ed packages in .julia/dev. I would like to erase everything else that is precompiled as cache, binary, lib, etc.

Is there a Pkg.reset() command that I could use to clean all these things up?

2 Likes
3 Likes

I followed the instructions in the PkgCleanup.jl README, the two commands:

using Pkg
using PkgCleanup
using Dates

PkgCleanup.manifests()
PkgCleanup.artifacts()

Pkg.gc(; collect_delay=Dates.Day(0))

They saved a lot of space already, but now I want to erase the contents of the compiled subfolder with old Julia versions:

Can I safely remove these folders by hand?

1 Like

Depends on what you mean by “safely”: compiled contains autogenerated files which will be automatically regenerated on demand, so it can probably be considered “safe”, but you’ll have to recompile a lot of stuff the first time you use a package again.

Yes, I want a fresh installation. Deleting anything that is not source code and that is not related to the latest Julia version, in this case Julia v1.9.

Maybe PkgCleanup.jl could provide a single command that does this “fresh installation” deleting all kinds of binaries and retaining only source code of package in the dev folder?

2 Likes

Please let us know the progress of this. I am interested in doing a clean up as well.
Thanks for sharing.

1 Like