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.
- 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. - You can set
Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true
. - You can use GitHub - fredrikekre/jlpkg: A command line interface (CLI) for Pkg, Julia's package manager. 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.