# How do I remove all my installed packages at once, if possible?

**URL:** <https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820>\
**Category:** New to Julia\
**Tags:** packages\
**Created:** [August 22, 2021, 10:00pm UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820 "2021-08-22T22:00:02Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![cybervigilante](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cybervigilante/32/26687_2.png) [@cybervigilante](https://discourse.julialang.org/u/cybervigilante)\
**Post date:** [August 22, 2021, 10:00pm UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/1 "2021-08-22T22:00:02Z")

</div>

When I first started Julia I installed a Lot of packages to try. Now I have two pagefulls with conflicts and it’s hard to figure out which pkg is the cause. I’d like to just delete the lot and reinstall the few I’ve found useful for now. Is there a way to do that?

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 22, 2021, 10:15pm UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/2 "2021-08-22T22:15:34Z")

</div>

delete `~/.julia/environments/v1.x`, x can be 6 or 7 depending on what you have. Note this won’t delete the packages’ source code, just the Manifest.toml that records your environment, so when you re install some packages, you won’t have to re download them all

---

<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:** [August 22, 2021, 10:21pm UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/3 "2021-08-22T22:21:14Z")

</div>

Also, this is a good occasion to learn to use local environments, instead of polluting the global one, which should really be as small as possible 🙂

BTW, a relatively unknown trick is to do

```julia
]activate --temp

```

to create a temporary one-off environment that will be automatically deleted at the end of the Julia session. It’s very useful to quickly try out some packages

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [August 23, 2021, 12:22am UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/4 "2021-08-23T00:22:28Z")

</div>

delete `~/.julia/environments/v1.x` , x

Doing this can break your startup.jl file, so you might want to rename it before you do this. Otherwise Julia will fail to start the REPL and you’ll have to deal with startup.jl anyhow.

My startup.jl file has lots of things like `using Revise` in it, for example.

---

<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:** [August 23, 2021, 12:32am UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/5 "2021-08-23T00:32:07Z")

</div>

> [@ctkelley](#):
>
> My startup.jl file has lots of things like `using Revise` in it, for example.

The [recommended configuration](https://timholy.github.io/Revise.jl/stable/config/) for Revise suggests putting `using Revise` in a `try`/`catch` block. Not relying on the global environment having third-party packages installed is good.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 23, 2021, 2:22am UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/6 "2021-08-23T02:22:42Z")

</div>

you can always get around the first time by

```julia
julia --startup-file=no

```

since we’re talking about deleting and reinstalling… this shouldn’t be too much on top of the hassle

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [August 23, 2021, 11:41pm UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/7 "2021-08-23T23:41:24Z")

</div>

> [@giordano](#):
>
> use local environments

Correct me if I’m wrong. But one thing I find annoying about local environments is that adding a package in the environment may cause it to be updated. Sometimes this triggers precompilation of many packages. It is not the same as just use a package that is already there.

---

<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:** [August 23, 2021, 11:58pm UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/8 "2021-08-23T23:58:40Z")

</div>

> [@lmiq](#):
>
> But one thing I find annoying about local environments is that adding a package in the environment may cause it to be updated.

As far as I know, local and global environments are no different in this regard: by default adding a package triggers an update (maybe only the first time in a session) and precompilation of all packages in the environment (that’d be way less than having everything in a single global environment).

> [@lmiq](#):
>
> Sometimes this triggers precompilation of many packages.

If you’re annoyed by precompilation, there is a trick to not update packages on `add`, it has been shared a few times here on discourse, many people put that code in their startup file

---

<div class="post-metadata">

**Author:** ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Post date:** [August 24, 2021, 12:07am UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/9 "2021-08-24T00:07:47Z")

</div>

I have never regretted deleting my `.julia` folder entirely and reinstalling everything from scratch. It is shockingly fast these days.

But as I think other people have said, if your global environment is getting mucked up, then it is almost certainly because you aren’t using project/manifest files sufficiently. The only things I have in my global environment is IJulia, Revise, and BenchmarkTools and the occasional others.

---

<div class="post-metadata">

**Author:** ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)\
**Post date:** [August 24, 2021, 12:16am UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/10 "2021-08-24T00:16:17Z")

</div>

> [@giordano](#):
>
> If you’re annoyed by precompilation, there is a trick to not update packages on `add` , it has been shared a few times here on discourse, many people put that code in their startup file

this: [How to disable automatic precompilation of packages in Julia 1.6](https://discourse.julialang.org/t/how-to-disable-automatic-precompilation-of-packages-in-julia-1-6/57053)

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [August 24, 2021, 1:24am UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/11 "2021-08-24T01:24:14Z")

</div>

> [@giordano](#):
>
> As far as I know, local and global environments are no different in this regard: by default adding a package triggers an update (maybe only the first time in a session) and precompilation of all packages in the environment (that’d be way less than having everything in a single global environment).

Yes, you’re right. It is not that exactly. The annoying thing is that a package that is installed in a local environment is not available to `using` in the other environments (as are the packages installed in the “main” environment). Thus, either one has to install things on the “main” environment, or keep adding packages to new environments every time.

---

<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:** [August 24, 2021, 10:07am UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/12 "2021-08-24T10:07:12Z")

</div>

I was talking about not updating, not not precompiling:

> [@What is in your startup.jl?](https://discourse.julialang.org/t/what-is-in-your-startup-jl/18228/12):
>
> Here is my updated one. I gave up on updating all packages # Disable updating registry on `add` (still runs on `up`), as it is slow using Pkg: Pkg Pkg.UPDATED\_REGISTRY\_THIS\_SESSION[] = true # use more colors for displaying Pkg conflicts if isdefined(Pkg.Resolve, :CONFLICT\_COLORS) append!(Pkg.Resolve.CONFLICT\_COLORS, [21:51; 55:119; 124:142; 160:184; 196:220]) end # Setup Revise.jl atreplinit() do repl try @eval using Revise @async Revise.wait\_steal\_repl\_backend() …

But I guess someone may not want to precompile (?)

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [November 5, 2022, 9:42pm UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/13 "2022-11-05T21:42:16Z")

</div>

I deleted the whole `.julia` folder with almost 20 GB, as suggested above, but after restarting Julia, the whole shebang is reinstalled again (200+ packages).

How to start from scratch?  
Thanks in advance.

_ **NB:** _  
_On Win11, with juliaup installed and using VS Code._

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [November 5, 2022, 9:53pm UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/14 "2022-11-05T21:53:53Z")

</div>

This is odd.  
Despite that deleting complete `.julia` is NOT recommended anymore, because you delete `dev`’ed packages too for example and may loose some work, julia should start clean and plain after deleting (or better renaming) .julia anyways.  
I just tried renaming .julia (Windows 10) and it just created it newly with only about 500MB and no packages reinstalled. There seems to be something special on your side. Any environment variables set? Like one or several of [Environment Variables · The Julia Language](https://docs.julialang.org/en/v1/manual/environment-variables/) ?

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [November 5, 2022, 10:04pm UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/15 "2022-11-05T22:04:38Z")

</div>

Thanks for your response.

Did another test, deleting again the new `.julia` folder (btw, I had made a backup of startup.jl beforehand) and typing in the Pkg REPL the following command:

```julia
] rm --all

```

( **EDIT** )  
… this removed all packages from default working enviroment but the list of 200+ packages were “restored” once again in `.\julia\packages`.  
However, their size on disk was dramatically reduced. Not clear for me what is going on here.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [November 5, 2022, 10:08pm UTC](https://discourse.julialang.org/t/how-do-i-remove-all-my-installed-packages-at-once-if-possible/66820/16 "2022-11-05T22:08:38Z")

</div>

My guess is you have something special in `JULIA_DEPOT_PATH`.
