# How to find package preventing others from updating

**URL:** https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235
**Category:** General Usage
**Tags:** packages, package-manager
**Created:** [January 8, 2018, 4:50pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235 "2018-01-08T16:50:31Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [January 8, 2018, 4:50pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/1 "2018-01-08T16:50:31Z")

</div>

While trying to upgrade a package I found that some other package held it back with an upper version bound. To track down the offending package, I found the following function useful

```julia
function find_holdback(held_back_package, recursive = 0, installed = collect(keys(Pkg.installed())), inset=0)
    @assert held_back_package ∈ installed "The package you are querying is not installed"
    for package in installed
        REQUIRE = Pkg.dir(package, "REQUIRE")
        isfile(REQUIRE) || continue
        for line in eachline(REQUIRE)
            splitline = split(line, ' ')
            splitline[1] == held_back_package || continue
            for i = 1:inset print(" ") end
            if length(splitline) > 2
                print_with_color(:red, @sprintf("Package %-35s requires %s\n", package, line))
            else
                @printf("Package %-35s requires %s\n", package, line)
            end
            recursive > 0 && find_holdback(package, recursive-1, installed, inset+1)
        end
    end
end

julia> find_holdback("ForwardDiff", 2) # Prints requires with a depth of 2

```

Example output:

```julia
julia> find_holdback("ForwardDiff", 2)
Package NLsolve requires ForwardDiff 0.3.0
    Package SteadyStateDiffEq requires NLsolve
        Package DifferentialEquations requires SteadyStateDiffEq 0.0.1
    Package DiffEqCallbacks requires NLsolve
        Package DifferentialEquations requires DiffEqCallbacks 0.0.2
    Package OrdinaryDiffEq requires NLsolve 0.9.1
        Package DelayDiffEq requires OrdinaryDiffEq 1.6.0
        Package DifferentialEquations requires OrdinaryDiffEq 2.0.0
    Package StochasticDiffEq requires NLsolve
        Package DifferentialEquations requires StochasticDiffEq 2.0.0
    Package FiniteElementDiffEq requires NLsolve 0.7.3
        Package DifferentialEquations requires FiniteElementDiffEq 0.3.0
Package ReverseDiffSparse requires ForwardDiff 0.3 0.5
    Package JuMP requires ReverseDiffSparse 0.7 0.8
Package Optim requires ForwardDiff 0.3.0 0.5.0
    Package NLsolve requires Optim
        Package SteadyStateDiffEq requires NLsolve
        Package DiffEqCallbacks requires NLsolve
        Package OrdinaryDiffEq requires NLsolve 0.9.1
        Package StochasticDiffEq requires NLsolve
        Package FiniteElementDiffEq requires NLsolve 0.7.3
    Package DiffEqParamEstim requires Optim
        Package DifferentialEquations requires DiffEqParamEstim 0.3.0
    Package KernelDensity requires Optim
        Package StatPlots requires KernelDensity
Package ReverseDiff requires ForwardDiff 0.3.4 0.5.0
    Package LTVModels requires ReverseDiff
        Package GuidedPolicySearch requires LTVModels
Package DiffEqCallbacks requires ForwardDiff 0.3.0
    Package DifferentialEquations requires DiffEqCallbacks 0.0.2
Package DiffEqParamEstim requires ForwardDiff
    Package DifferentialEquations requires DiffEqParamEstim 0.3.0
Package Roots requires ForwardDiff 0.2.0
    Package Sundials requires Roots
        Package DifferentialEquations requires Sundials 0.11.0
    Package OrdinaryDiffEq requires Roots 0.2.1
        Package DelayDiffEq requires OrdinaryDiffEq 1.6.0
        Package DifferentialEquations requires OrdinaryDiffEq 2.0.0
    Package StochasticDiffEq requires Roots
        Package DifferentialEquations requires StochasticDiffEq 2.0.0
Package OrdinaryDiffEq requires ForwardDiff 0.2.4
    Package DelayDiffEq requires OrdinaryDiffEq 1.6.0
        Package DifferentialEquations requires DelayDiffEq 0.3.0
    Package DifferentialEquations requires OrdinaryDiffEq 2.0.0
Package Flux requires ForwardDiff
Package JuMP requires ForwardDiff 0.3 0.5
Package StochasticDiffEq requires ForwardDiff
    Package DifferentialEquations requires StochasticDiffEq 2.0.0

```

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [January 8, 2018, 5:02pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/2 "2018-01-08T17:02:30Z")

</div>

Great stuff! Thanks for sharing.

---

<div class="post-metadata">

### Author: ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)
#### Post date: [January 9, 2018, 3:34am UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/3 "2018-01-09T03:34:27Z")

</div>

I like this, but IIUC your approach is not quite right when an upper bound is introduced via METADATA. This occurred, for example, when the recent breaking revision of DataFrames forced them to bound all dependencies. You could handle these cases by getting the `line`s from `METADATA/$package/versions/$version/requires` file instead of the package’s REQUIRE file.

---

<div class="post-metadata">

### Author: ![floswald](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/floswald/32/195_2.png) [@floswald](https://discourse.julialang.org/u/floswald)
#### Post date: [January 16, 2018, 10:57am UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/4 "2018-01-16T10:57:12Z")

</div>

just in case someone finds this useful, here is an alternative proposed by @Tamas_Papp:

```julia
➜ FredData git:(master) grep DataFrames ~/.julia/v0.6/**/REQUIRE
/Users/74097/.julia/v0.6/DataFramesMeta/REQUIRE:DataFrames
/Users/74097/.julia/v0.6/Fertility/REQUIRE:DataFrames
/Users/74097/.julia/v0.6/FredData/REQUIRE:DataFrames
/Users/74097/.julia/v0.6/GLM/test/REQUIRE:DataFrames 0.9.0
/Users/74097/.julia/v0.6/JLD/test/REQUIRE:DataFrames
/Users/74097/.julia/v0.6/MomentOpt/REQUIRE:DataFrames
/Users/74097/.julia/v0.6/MomentOpt/REQUIRE:DataFramesMeta
/Users/74097/.julia/v0.6/MomentOpt/test/REQUIRE:DataFrames
/Users/74097/.julia/v0.6/QuantileRegression/REQUIRE:DataFrames
/Users/74097/.julia/v0.6/Query/test/REQUIRE:DataFrames
/Users/74097/.julia/v0.6/RData/REQUIRE:DataFrames 0.9
/Users/74097/.julia/v0.6/StatsBase/test/REQUIRE:DataFrames

```

---

<div class="post-metadata">

### Author: ![richardreeve](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/richardreeve/32/2257_2.png) [@richardreeve](https://discourse.julialang.org/u/richardreeve)
#### Post date: [January 17, 2018, 12:13pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/5 "2018-01-17T12:13:07Z")

</div>

This looks like a really handy function, but it doesn’t seem to be helping me - I wonder if anyone can see what’s going on? I want the latest version of RCall (0.9.0, soon to be 0.10.0), but it’ll only give me 0.8.1. Installing RCall, I see:

```julia
julia> Pkg.update()
INFO: Updating METADATA...
INFO: Updating ArchGDAL master...
INFO: Updating JuliaDB master...
INFO: Updating ECCodes master...
INFO: Updating Phylo master...
INFO: Updating AxisArrays master...
INFO: Updating Distances master...
INFO: Updating ECCodesExamples master...
INFO: Updating Unitful master...
INFO: Updating GDAL master...
INFO: Updating Junet master...
WARNING: Package Diversity: skipping update (dirty)...
WARNING: Package FluData: skipping update (dirty)...
INFO: Computing changes...
INFO: No packages to install, update or remove

julia> Pkg.add("RCall")
INFO: Installing NamedArrays v0.7.0
INFO: Installing RCall v0.8.1
INFO: Building SpecialFunctions
INFO: Package database updated

julia> find_holdback("RCall", 2)

julia> Pkg.status("RCall")
 - RCall 0.8.1

```

```julia
julia> Pkg.checkout("RCall")
INFO: Checking out RCall master...
INFO: Pulling RCall latest master...
ERROR: resolve is unable to satisfy package requirements.
  The problem was detected when trying to find a feasible version
  for package CategoricalArrays.
  However, this only means that package CategoricalArrays is involved in an
  unsatisfiable or difficult dependency relation, and the root of
  the problem may be elsewhere.

Stacktrace:
 [1] resolve(::Dict{String,Base.Pkg.Types.VersionSet}, ::Dict{String,Dict{VersionNumber,Base.Pkg.Types.Available}}) at ./pkg/resolve.jl:48
...

```

Suggesting there’s some problem with dependencies for `CategoricalArrays`, but when I use `find_holdback()` again, I just get:

```julia
julia> find_holdback("CategoricalArrays", 2)
Package DataTables requires CategoricalArrays 0.1.2
Package Feather requires CategoricalArrays 0.0.6
Package RCall requires CategoricalArrays 0.1.0
Package DataStreams requires CategoricalArrays 0.0.5
    Package DataTables requires DataStreams 0.1.0
    Package ArchGDAL requires DataStreams
    Package Feather requires DataStreams 0.1.0

```

And nothing has an upper bound on `CategoricalArrays`. In fact searching through the `REQUIRE` files, I see almost nothing with an upper bound on anything any longer (LearnBase and IntervalTrees for some reason). Any suggestions?

---

<div class="post-metadata">

### Author: ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)
#### Post date: [January 19, 2018, 9:58pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/6 "2018-01-19T21:58:43Z")

</div>

DataTables (at least) requires an old CategoricalArrays version.

---

<div class="post-metadata">

### Author: ![richardreeve](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/richardreeve/32/2257_2.png) [@richardreeve](https://discourse.julialang.org/u/richardreeve)
#### Post date: [January 20, 2018, 10:03pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/7 "2018-01-20T22:03:43Z")

</div>

Thanks. According to my `.julia/v0.6` folder, DataTables has a pretty simple:

```julia
CategoricalArrays 0.1.2

```

requirement with no upper limit (as suggested by `find_holdback()`). However, I’ve just deleted the whole folder and reinstalled some things and the problem seems to have gone away. I haven’t reinstalled everything, but touch wood the problem has gone away…

---

<div class="post-metadata">

### Author: ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)
#### Post date: [January 20, 2018, 10:33pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/8 "2018-01-20T22:33:01Z")

</div>

I think the problem is that the package manager uses the information present in METADATA, which doesn’t necessarily reflect the one returned by the script, which looks at each package’s directory. In the present case, we have added upper bounds to METADATA, and updated DataTables master, but no release has been tagged.

---

<div class="post-metadata">

### Author: ![richardreeve](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/richardreeve/32/2257_2.png) [@richardreeve](https://discourse.julialang.org/u/richardreeve)
#### Post date: [January 20, 2018, 11:48pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/9 "2018-01-20T23:48:35Z")

</div>

Ah, okay. Perfect. Adding DataTables makes everything fall apart. That clarifies everything. I’d forgotten that METADATA can be changed without changing the underlying packages.

---

<div class="post-metadata">

### Author: ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)
#### Post date: [February 19, 2018, 4:19pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/10 "2018-02-19T16:19:15Z")

</div>

Is there a way to find all held back packages (instead of the packages holding one package back)?

---

<div class="post-metadata">

### Author: ![bafonso](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bafonso/32/7109_2.png) [@bafonso](https://discourse.julialang.org/u/bafonso)
#### Post date: [June 15, 2020, 3:14am UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/11 "2020-06-15T03:14:34Z")

</div>

Seems like this would be very useful to even be in Julia Package manager. Has anyone made some changes to use METADATA?

---

<div class="post-metadata">

### Author: ![IljaK91](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iljak91/32/44301_2.png) [@IljaK91](https://discourse.julialang.org/u/IljaK91)
#### Post date: [July 16, 2020, 9:07am UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/12 "2020-07-16T09:07:12Z")

</div>

Is there something similar that can be used with a recent version of Julia? I my case I would like to update CSV/DataFrames, but not sure what is holding those packages back.

---

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [July 16, 2020, 9:17am UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/13 "2020-07-16T09:17:55Z")

</div>

It’s built into the package manager. Try

```julia
pkg> add CSV@<LATEST_VERIONS>

```

where you replace `<LATEST_VERIONS>` for the version number, i.e.,

```julia
pkg> add CSV@0.7.3

```

---

<div class="post-metadata">

### Author: ![IljaK91](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iljak91/32/44301_2.png) [@IljaK91](https://discourse.julialang.org/u/IljaK91)
#### Post date: [July 16, 2020, 9:19am UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/14 "2020-07-16T09:19:46Z")

</div>

Well, that worked surprisingly well. Awesome!

---

<div class="post-metadata">

### Author: ![liuyxpp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/liuyxpp/32/9870_2.png) [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)
#### Post date: [September 3, 2020, 6:32am UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/15 "2020-09-03T06:32:05Z")

</div>

This function seems not work in Julia v1.5

---

<div class="post-metadata">

### Author: ![ptoche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ptoche/32/23554_2.png) [@ptoche](https://discourse.julialang.org/u/ptoche)
#### Post date: [May 16, 2021, 5:53am UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/17 "2021-05-16T05:53:43Z")

</div>

I was greatly interested in this `find_holdback`. I don’t understand the claim that it is now “built” into the package manager. Please forgive me for bumping this topic. How do you get a list of packages and their “requires”? Here’s the best I could find:

```
# Query package information as seen on https://github.com/invenia/JLSO.jl/issues/32
deps = Pkg.dependencies()
# Dict{Base.UUID, Pkg.Types.PackageInfo}
for (key, value) in deps
    info = deps[key]
    for fname in fieldnames(typeof(info))
        println(fname,": ", getfield(info, fname))
    end
end

```

which yields a gigantic list of elements like this one (the first one in my case):

```
name: DataValueInterfaces
version: 1.0.0
tree_hash: bfc1187b79289637fa0ef6d4436ebdfe6905cbd6
is_direct_dep: false
is_pinned: false
is_tracking_path: false
is_tracking_repo: false
is_tracking_registry: true
git_revision: nothing
git_source: nothing
source: /Users/julia/.julia/packages/DataValueInterfaces/0j6Kp
dependencies: Dict{String, Base.UUID}()

```

By the way another way to request a specific package version (I personally don’t use `]?` because I don’t know how to exit the `Pkg` prompt to go back to the Julia prompt 🤣):

```
Pkg.add(Pkg.PackageSpec(;name = "CSV", version="0.8.4"))

```

However, this will not help discover a compatibility problem. And Julia will not obey the command if there’s an incompatibility, as far as I could tell. You cannot **force** a version if it’s not compatible. You cannot “push” incompatibility issues to another package. As far as I can tell in my limited experience.

P.S. A couple of things are broken with `find_holdback`. Is it beyond repair? `Pkg.installed` is now `Pkg.dependencies` and I think you need `using Printf` too.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [May 16, 2021, 8:50am UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/18 "2021-05-16T08:50:27Z")

</div>

What do you mean by “Julia will not obey the command of there’s an incompatibility”? Presumably this means that it will raise an error, which will then tell you what the incompatibility is?

Also you get out of the package REPL mode (like all other REPL modes AFAIK) by pressing backspace.

---

<div class="post-metadata">

### Author: ![ptoche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ptoche/32/23554_2.png) [@ptoche](https://discourse.julialang.org/u/ptoche)
#### Post date: [May 16, 2021, 11:19pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/19 "2021-05-16T23:19:47Z")

</div>

> > What do you mean by “Julia will not obey the command if there’s an incompatibility”?

All I mean is that after I identified that `ImplicitPlots` was holding back `StaticArrays` to some paleolithic version, I did `Pkg.rm("ImplicitPlots")` followed by `Pkg.update("StaticArrays")`, but “Julia did not obey” in the sense that I was still stuck with the super old version of `StaticArrays`:

```
Updating registry at `~/.julia/registries/General`
  No Changes to `~/Julia/workspace/Project.toml`
  No Changes to `~/Julia/workspace/Manifest.toml`

```

Deleting all the packages listed in the `Project.toml` and `Manifest.toml` (and additionally manually removing the old version of `StaticArrays` out of superstiscion) and then reinstalling my packages except `ImplicitPlots` was how I managed to update `StaticArrays`. In other words, removing the package that was holding things back was not enough. `StaticArrays` was held back even after removing the package with the outdated manifest. Throwing in `Pkg.resolve()` didn’t do a thing for me. Also, conservatively removing the line with the old version number and/or the entire `StaticArrays` entry in the `Manifest.toml` causes a complete crash (the file header does say `"# This file is machine-generated - editing it directly is not advised"`, so no hard feelings. 🤭

> > you get out of the package REPL mode (like all other REPL modes AFAIK) by pressing backspace.

Oh excellent, that should have been obvious. On my keyboard that’s the “delete” key. `help?>` takes you out immediately after returning info and you can get out of it with a simple “return”. Meanwhile in vscode/juno, the “escape” key does that kind of thing. So I never got to learn about backspace. 👍

---

<div class="post-metadata">

### Author: ![Xing\_Shi\_Cai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xing_shi_cai/32/14128_2.png) [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)
#### Post date: [October 8, 2024, 11:54am UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/20 "2024-10-08T11:54:56Z")

</div>

I find if I add a specific version might get other packages downgraded. For example –

```julia
pkg> add Graphs@1.11
   Resolving package versions...
   Installed FFMPEG ───────── v0.2.4
   Installed BinaryProvider ─ v0.5.10
   Installed Plots ────────── v1.40.1
   Installed Graphs ───────── v1.11.2
    Updating `~/code/teaching/compsci203/core/quizzes/problem-bank/graph-theory/chromatic-number/Project.toml`
⌃ [86223c79] ↑ Graphs v1.9.0 ⇒ v1.11.2
    Updating `~/code/teaching/compsci203/core/quizzes/problem-bank/graph-theory/chromatic-number/Manifest.toml`
  [ec485272] ↑ ArnoldiMethod v0.2.0 ⇒ v0.4.0
  [b99e7846] + BinaryProvider v0.5.10
⌃ [c87230d0] ↓ FFMPEG v0.4.2 ⇒ v0.2.4
  [6a86dc24] ↑ FiniteDiff v2.25.0 ⇒ v2.26.0
⌃ [86223c79] ↑ Graphs v1.9.0 ⇒ v1.11.2
⌃ [91a5bcdd] ↓ Plots v1.40.8 ⇒ v1.40.1
  [3bb67fe8] ↑ TranscodingStreams v0.11.2 ⇒ v0.11.3
  [83423d85] ↑ Cairo_jll v1.18.0+2 ⇒ v1.18.2+1
  [b22a6f82] ↑ FFMPEG_jll v4.4.4+1 ⇒ v6.1.2+0
  [1270edf5] ↑ x264_jll v2021.5.5+0 ⇒ v10164.0.0+0
⌅ [dfaa095f] ↑ x265_jll v3.5.0+0 ⇒ v3.6.0+0
        Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`
    Building FFMPEG → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/9143266ba77d3313a4cf61d8333a1970e8c5d8b6/build.log`
Precompiling project...
  13 dependencies successfully precompiled in 92 seconds. 354 already precompiled.

```

---

<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: [October 8, 2024, 12:02pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235/21 "2024-10-08T12:02:46Z")

</div>

> [@Xing\_Shi\_Cai](#):
>
> `⌅ [dfaa095f] ↑ x265_jll v3.5.0+0 ⇒ v3.6.0+0`

see the `⌅`? that’s the limiting factor
