# Update a package updates everything?

**URL:** <https://discourse.julialang.org/t/update-a-package-updates-everything/61868>\
**Category:** General Usage\
**Tags:** package-manager\
**Created:** [May 26, 2021, 4:41pm UTC](https://discourse.julialang.org/t/update-a-package-updates-everything/61868 "2021-05-26T16:41:29Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [May 26, 2021, 4:41pm UTC](https://discourse.julialang.org/t/update-a-package-updates-everything/61868/1 "2021-05-26T16:41:29Z")

</div>

This topic is similar to this old one:

> [@Installing package seems to update everything unintentionally?](https://discourse.julialang.org/t/installing-package-seems-to-update-everything-unintentionally/25134):
>
> I was under the impression that installing a new package should not update any existing packages, unless this is required to satisfy dependencies. Nevertheless, I feel like this is what happens whenever I install anything new. Here’s an example from just now, I installed ApproxFun and got an update to e.g. GPUArrays, which doesn’t seem to be anywhere in ApproxFun’s dependency tree (which I verified by installing ApproxFun into a clean environment, in which case GPUArrays was not installed): (v1…

But I do not think that a complete answer was provided there.

Whenever I update any package, it seems that all other (or a huge number of them) get updated. For example:

```julia
@v1.6) pkg> up SPGBox
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Installed SPGBox ─ v0.2.1
    Updating `~/.julia/environments/v1.6/Project.toml`
  [bf97046b] ↑ SPGBox v0.2.0 ⇒ v0.2.1
    Updating `~/.julia/environments/v1.6/Manifest.toml`
  [3da002f7] ↓ ColorTypes v0.11.0 ⇒ v0.10.12
  [82e4d734] ↑ ImageIO v0.4.1 ⇒ v0.5.4
  [eebad327] + PkgVersion v0.1.1
  [bf97046b] ↑ SPGBox v0.2.0 ⇒ v0.2.1
  [731e570b] + TiffImages v0.3.2
Precompiling project...
  39 dependencies successfully precompiled in 84 seconds (342 already precompiled)

```

SPGBox, the package that was to be updated, has only “Julia 1” [as a dependency](https://github.com/m3g/SPGBox.jl/blob/master/Project.toml).

The thing is that for this kind of thing I am getting very frequent updates precompilations of CUDA, Flux and Plots, and particularly the first two are packages I do not use often. And these precompilations take too long to be ok in the middle of another work.

I know that I could be obsessive and work with different environments to avoid that, but that is quite annoying for daily use.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 27, 2021, 9:09am UTC](https://discourse.julialang.org/t/update-a-package-updates-everything/61868/2 "2021-05-27T09:09:12Z")

</div>

`Pkg.update` allows some control over what is updated — see its [docs](https://pkgdocs.julialang.org/v1/api/#Pkg.update).

That said, from 1.6 onwards working with different (and even temporary) environments as necessary may be the best solution; I would not call is obsessive, just convenient.

---

<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:** [May 27, 2021, 11:10am UTC](https://discourse.julialang.org/t/update-a-package-updates-everything/61868/3 "2021-05-27T11:10:46Z")

</div>

It is a little bit messy for me. I would have to remember which was the environment where I had installed `DelimitedFiles`, or `Flux`, or whatever, or reinstall it in the temporary module each time.

---

<div class="post-metadata">

**Author:** ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Post date:** [May 27, 2021, 11:10am UTC](https://discourse.julialang.org/t/update-a-package-updates-everything/61868/4 "2021-05-27T11:10:53Z")

</div>

I also experienced this. Why would the default behavior be to update everything if that particular package has only one dependency? I find it unrelated to environments.

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [May 27, 2021, 12:07pm UTC](https://discourse.julialang.org/t/update-a-package-updates-everything/61868/5 "2021-05-27T12:07:42Z")

</div>

I’ve wondered about this too. It’s even been faster for me to update and then just immediately restart the REPL, especially when using packages with longer compile times.

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [May 27, 2021, 12:15pm UTC](https://discourse.julialang.org/t/update-a-package-updates-everything/61868/6 "2021-05-27T12:15:41Z")

</div>

The linked discourse thread was helpful. I’ll have to try playing around with the `—preserve` option.

---

<div class="post-metadata">

**Author:** ![tencnivel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tencnivel/32/8662_2.png) [@tencnivel](https://discourse.julialang.org/u/tencnivel)\
**Post date:** [November 15, 2021, 9:41pm UTC](https://discourse.julialang.org/t/update-a-package-updates-everything/61868/7 "2021-11-15T21:41:40Z")

</div>

We run into the same problem.  
We have a package `MyPackage` that has a dependency to package `MyDependency`.  
Package `MyPackage` has a Manifest.toml.  
Package `MyDependency` has no Manifest.toml.

We want to upgrade the version of B in `MyPackage` from version 0.7.0 to 0.7.1 by running `(MyPackage) pkg > update MyDependency`

Package `MyDependency` has no difference between version 0.7.0 and 0.7.1 in terms of dependency.

```julia
(MyPackage) pkg> update MyDependency
    Updating registry at `~/.julia/registries/General`
    Updating registry at `~/.julia/registries/MyJuliaRegistry`
    Updating git-repo `git@github.mycompany.com:risk/JuliaRegistry.git`
    Updating `/home/my_user/MyPackage.jl-debug-update/Project.toml`
  [c5dd4ef6] ↑ MyDependency v0.7.0 ⇒ v0.7.1
    Updating `/home/my_user/MyPackage.jl-debug-update/Manifest.toml`
  [fbe9abb3] ↑ AWS v1.67.0 ⇒ v1.71.0
  [324d7699] ↑ CategoricalArrays v0.10.1 ⇒ v0.10.2
  [d360d2e6] ↑ ChainRulesCore v1.10.1 ⇒ v1.11.1
  [9e997f8a] + ChangesOfVariables v0.1.1
  [34da2185] ↑ Compat v3.39.0 ⇒ v3.40.0
  [48062228] ↑ FilePathsBase v0.9.12 ⇒ v0.9.14
  [3587e190] ↑ InverseFunctions v0.1.1 ⇒ v0.1.2
  [2ab3a3ac] ↑ LogExpFunctions v0.3.4 ⇒ v0.3.5
  [1914dd2f] ↑ MacroTools v0.5.8 ⇒ v0.5.9
  [90014a1f] ↑ PDMats v0.11.1 ⇒ v0.11.3
  [c5dd4ef6] ↑ MyDependency v0.7.0 ⇒ v0.7.1
  [79098fc4] ↑ Rmath v0.6.1 ⇒ v0.7.0
  [c35d69d1] ↑ SMTPClient v0.6.0 ⇒ v0.6.1
  [91c51154] ↑ SentinelArrays v1.3.7 ⇒ v1.3.8
  [276daf66] ↑ SpecialFunctions v1.8.0 ⇒ v1.8.1
  [4c63d2b9] ↑ StatsFuns v0.9.12 ⇒ v0.9.13
  [81def892] ↑ VersionParsing v1.2.0 ⇒ v1.2.1
  [94ce4f54] ↑ Libiconv_jll v1.16.0+8 ⇒ v1.16.1+1
  [5ced341a] ↑ Lz4_jll v1.9.2+2 ⇒ v1.9.3+0
  [efe28fd5] ↑ OpenSpecFun_jll v0.5.3+4 ⇒ v0.5.5+0
  [f50d1b31] ↑ Rmath_jll v0.2.2+2 ⇒ v0.3.0+0
  [02c8fc9c] ↑ XML2_jll v2.9.10+3 ⇒ v2.9.12+0
  [3161d3a3] ↑ Zstd_jll v1.4.8+0 ⇒ v1.5.0+0
  [a9144af2] ↑ libsodium_jll v1.0.19+0 ⇒ v1.0.20+0
  [0dad84c5] ~ ArgTools v1.1.1 ⇒ 
  [56f22d72] ~ Artifacts v1.3.0 ⇒ 
  [f43a241f] ~ Downloads v1.5.1 ⇒ 
  [4af54fe1] ~ LazyArtifacts v1.3.0 ⇒ 
  [b27032c2] ~ LibCURL v0.6.3 ⇒ 
  [ca575930] ~ NetworkOptions v1.2.0 ⇒ 
  [fa267f1f] ~ TOML v1.0.3 ⇒ 
  [a4e569a6] + Tar
  [e66e0078] ~ CompilerSupportLibraries_jll v0.3.4+0 ⇒ 
  [deac9b47] ~ LibCURL_jll v7.70.0+2 ⇒ 
  [29816b5a] ~ LibSSH2_jll v1.9.0+3 ⇒ 
  [c8ffd9c3] ~ MbedTLS_jll v2.16.8+1 ⇒ 
  [14a3606d] ~ MozillaCACerts_jll v2021.1.19+0 ⇒ 
  [05823500] ~ OpenLibm_jll v0.7.1+0 ⇒ 
  [83775a58] ~ Zlib_jll v1.2.11+18 ⇒ 
  [8e850ede] ~ nghttp2_jll v1.40.0+2 ⇒ 
  [3f19e933] + p7zip_jll

```

Side note :  
`Pkg.update("MyDependency";level = UPLEVEL_PATCH)` has kind of the same problem, it updates everything to the lastest minor version.
