Pkg operations without updating registry

Is it possibly to run Pkg operations like add and instantiate without updating the registry? Since my registry is on NFS, updating it is slow, and having it update every few minutes when doing a lot of package operations and experimentation (switching versions, adding packages that are already available in my depot, trying different manifests) is a real nuisance. Cutting the internet connection works, but that’s not really an option. :wink:

There is a PR for an “offline mode”: https://github.com/JuliaLang/Pkg.jl/pull/1265 but needs to be updated for the new artifact system etc.

Edit:
Sorry I misread, you just don’t want to update the registry.

  1. You can delete the .git folder inside the registry to stop it from updating, but then you have to remember to manually update when you need/want to.
  2. You can set Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true.
  3. You can use https://github.com/fredrikekre/jlpkg where option 2 is default. E.g. $ jlpkg add Example would not update the registry.

Note also that on Julia 1.5 (and also Julia 1.4 if you set JULIA_PKG_SERVER="pkg.julialang.org") Pkg will just download the registry without using git, so that should also help.

3 Likes

Pkg.UPDATED_REGISTRY_THIS_SESSION should do the trick, thanks!

1 Like

That would come in so handy in large-scale installations with networked/cluster storage!