# How to cleanup artifacts folder

**URL:** <https://discourse.julialang.org/t/how-to-cleanup-artifacts-folder/101277>\
**Category:** General Usage\
**Tags:** memory, installation, artifacts\
**Created:** [July 6, 2023, 9:20pm UTC](https://discourse.julialang.org/t/how-to-cleanup-artifacts-folder/101277 "2023-07-06T21:20:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 6, 2023, 9:20pm UTC](https://discourse.julialang.org/t/how-to-cleanup-artifacts-folder/101277/1 "2023-07-06T21:20:53Z")

</div>

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

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/5/35602e21d6bf43bc12df8375695ab30e5180d6e3.png)

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?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [July 6, 2023, 10:12pm UTC](https://discourse.julialang.org/t/how-to-cleanup-artifacts-folder/101277/2 "2023-07-06T22:12:00Z")

</div>

> **[GitHub - giordano/PkgCleanup.jl: Cleanup unused Julia environments and artifacts](https://github.com/giordano/PkgCleanup.jl)**
>
> Cleanup unused Julia environments and artifacts. Contribute to giordano/PkgCleanup.jl development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 6, 2023, 10:46pm UTC](https://discourse.julialang.org/t/how-to-cleanup-artifacts-folder/101277/3 "2023-07-06T22:46:26Z")

</div>

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

```julia
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:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/a/dade29099b584ed52a4ca7f21b21b2af68689548.png)

Can I safely remove these folders by hand?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [July 6, 2023, 10:59pm UTC](https://discourse.julialang.org/t/how-to-cleanup-artifacts-folder/101277/4 "2023-07-06T22:59:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 6, 2023, 11:10pm UTC](https://discourse.julialang.org/t/how-to-cleanup-artifacts-folder/101277/5 "2023-07-06T23:10:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [July 6, 2023, 11:12pm UTC](https://discourse.julialang.org/t/how-to-cleanup-artifacts-folder/101277/6 "2023-07-06T23:12:58Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![klwlevy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klwlevy/32/25272_2.png) [@klwlevy](https://discourse.julialang.org/u/klwlevy)\
**Post date:** [July 7, 2023, 6:59am UTC](https://discourse.julialang.org/t/how-to-cleanup-artifacts-folder/101277/7 "2023-07-07T06:59:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [December 14, 2025, 7:00pm UTC](https://discourse.julialang.org/t/how-to-cleanup-artifacts-folder/101277/8 "2025-12-14T19:00:05Z")

</div>

@giordano I had to manually delete the `compiled` subfolders for old Julia versions again after running PkgCleanup.jl. I can’t find a good reason to preserve compiled files for old versions of the language that are no longer installed.

Could this step be included in the default PkgCleanup.jl command from the README?

As a side note, it would be great if `juliaup` had a `cleanup` command to erase all files from versions that are no longer installed.
