# Update packages without restarting

**URL:** <https://discourse.julialang.org/t/update-packages-without-restarting/68417>\
**Category:** General Usage\
**Tags:** package-manager\
**Created:** [September 19, 2021, 4:37pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417 "2021-09-19T16:37:42Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [September 19, 2021, 4:37pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/1 "2021-09-19T16:37:42Z")

</div>

I don’t like having to restart Julia when I update packages because I lose my state and have to wait 10 minutes or more to get back to it, usually once or twice a day.

Is it possible to avoid this? Is that a feature Julia could have in the future, or is that impossible?

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [September 19, 2021, 4:45pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/2 "2021-09-19T16:45:07Z")

</div>

you have to restart. it’s probably possible that a future version would support this, bit it’s kind of hard to imagine it being a necessary feature.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [September 19, 2021, 4:56pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/3 "2021-09-19T16:56:53Z")

</div>

Just to confirm, are you putting all projects in separate environments? Updating all your packages twice a day seems like a sign you have too many packages in a single environment.

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [September 19, 2021, 5:04pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/4 "2021-09-19T17:04:28Z")

</div>

My projects are in separate environments. This happens in a single project. It is inconvenient to have a lot of packages in a project for the reason I said, but aside from this issue I haven’t had a problem with the number of packages.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 19, 2021, 6:09pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/5 "2021-09-19T18:09:28Z")

</div>

> [@jzr](#):
>
> when I update packages because I lose my state and have to wait 10 minutes or more to get back to it, usually once or twice a day

You update all of your packages once or twice a day? Why?

(If you are _developing_ a package, see the [Revise.jl package](https://github.com/timholy/Revise.jl) — you typically don’t need to restart at all.)

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [September 19, 2021, 6:15pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/6 "2021-09-19T18:15:34Z")

</div>

> [@stevengj](#):
>
> You update all of your packages once or twice a day? Why?

No – once or twice a day I update some package and have to restart in order to use it.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [September 19, 2021, 6:46pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/7 "2021-09-19T18:46:44Z")

</div>

It isn’t clear if it is your package, but presuming it is, pay attention to @stevengj 's reference to Revise.jl. If you are not familiar with it, check it out. Seriously worth its weight in bitcoins.

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [September 19, 2021, 6:47pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/8 "2021-09-19T18:47:53Z")

</div>

No they are dependencies of my project.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [September 19, 2021, 6:51pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/9 "2021-09-19T18:51:31Z")

</div>

Hmm, and these dependencies change once or twice a day!? That is hard to believe.

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [September 19, 2021, 7:07pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/10 "2021-09-19T19:07:41Z")

</div>

I don’t have the data, but I think many packages update every n days. Having more than n dependencies means more than one daily update.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [September 19, 2021, 8:07pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/11 "2021-09-19T20:07:01Z")

</div>

It still sounds somewhat unusual to update daily even if there’s something new to update to every day. I rarely update dependencies of anything more often than once a month or so. I guess you’re using a particularly vibrant part of the package ecosystem where things happen all the time and it’s rewarding to live on the bleeding edge.

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [September 19, 2021, 8:37pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/12 "2021-09-19T20:37:05Z")

</div>

If you don’t want to update, you can `]pin --all` all your dependencies in your environments. You’ll have to unpin and update manually though.

---

<div class="post-metadata">

**Author:** ![astrobc1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/astrobc1/32/45632_2.png) [@astrobc1](https://discourse.julialang.org/u/astrobc1)\
**Post date:** [September 20, 2021, 12:44am UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/13 "2021-09-20T00:44:17Z")

</div>

Is there a good reason to update these third party packages (dependencies)? The changes are likely small/insignificant for your purposes so you can probably get away with updating them far less frequently.

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [September 20, 2021, 1:07am UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/14 "2021-09-20T01:07:06Z")

</div>

I only update them when I need to for a bugfix or feature.

---

<div class="post-metadata">

**Author:** ![Brad\_Carman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brad_carman/32/17631_2.png) [@Brad\_Carman](https://discourse.julialang.org/u/Brad_Carman)\
**Post date:** [May 9, 2022, 3:25pm UTC](https://discourse.julialang.org/t/update-packages-without-restarting/68417/15 "2022-05-09T15:25:49Z")

</div>

Even though it is stated that updating packages regularly is rare, I find myself updating packages all the time. Partly this is because I’m developing a whole suite of packages and as I update them I need to update my working environment, but also I’m also consuming packages in the ecosystem that are on the bleeding edge and have significant changes with each update (i.e. ModelingToolkit.jl).

I know that if I have my dependencies added to my working environment as “developed”, then Revise.jl will do it’s thing. But in some cases I would like to be using the “published” version in which case Revise.jl will no longer track changes when updating versions. Why use the published version? Because I may be making some breaking changes to one of the dependencies, and I’d like my working environment to be set to a particular published version.

Maybe the solution is to have my working environment set to developed mode for all my dependencies, and when I need to make breaking changes I clone the changing package in a different path. Then I have a path for my working version, and a path for my changing version. Is this what the community recommends?
