LocalRegistry doesn't automatically pull

It’s the same for General and other registries, either none is updated automatically or all registries are. What might fool you is that Pkg only does an automatic update once per session, so if you want to refresh the registry information more than once in a session, you must do an explicit update.

Illustration of both registries being updated:

$ mkdir /tmp/testdepot
$ mkdir /tmp/testregistry/
$ git -C /tmp/testregistry/ init --bare
Initialized empty Git repository in /tmp/testregistry/
$ JULIA_DEPOT_PATH=/tmp/testdepot julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.9 (2025-03-10)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.10) pkg> add LocalRegistry
  Installing known registries into `/tmp/testdepot`
       Added `General` registry to /tmp/testdepot/registries
    Updating registry at `/tmp/testdepot/registries/General.toml`
   Resolving package versions...
[...]

julia> using LocalRegistry

julia> create_registry("testregistry", "file:///tmp/testregistry", push = true)
[...]
[ Info: Created registry in directory /tmp/testdepot/registries/testregistry
"/tmp/testdepot/registries/testregistry"

julia> exit()
$ JULIA_DEPOT_PATH=/tmp/testdepot julia
[...]

(@v1.10) pkg> add Example
    Updating registry at `/tmp/testdepot/registries/testregistry`
    Updating git-repo `file:///tmp/testregistry`
    Updating registry at `/tmp/testdepot/registries/General.toml`
   Resolving package versions...
   Installed Example ─ v0.5.5
    Updating `/tmp/testdepot/environments/v1.10/Project.toml`
  [7876af07] + Example v0.5.5
    Updating `/tmp/testdepot/environments/v1.10/Manifest.toml`
  [7876af07] + Example v0.5.5
Precompiling packages finished.
  1 dependency successfully precompiled in 1 seconds. 4 already precompiled.
5 Likes