When I Pkg.update
in Julia 1.5, Pkg
seems to still pull from github:
(@v1.5) pkg> up
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General`
Updating registry at `~/.julia/registries/registryLH`
Updating git-repo `https://github.com/hendri54/registryLH`
No Changes to `~/.julia/environments/v1.5/Project.toml`
No Changes to `~/.julia/environments/v1.5/Manifest.toml`
Is there a setting that I need to change to switch to the new Pkg protocol?
1 Like
You probably have the General registry as a git repo. Delete it and install it again.
5 Likes
Thank you.
To save other some time, here is what worked for me:
Pkg.Registry.rm("General")
Pkg.Registry.add("General")
Adding via a RegistrySpec(name = "General", url = "https://pkg.julialang.org")
did not work (it fell back to installing from github).
12 Likes
You can also do this in Pkg mode with
pkg> registry rm General
pkg> registry add General
The add step can also be done without argument
pkg> registry add
which will install all registries that are known to the package server you are connected to. The default package servers only know about the General registry but it’s possible to set up custom package servers, e.g. in a corporate environment, that can serve additional registries.
Finally, if you have removed all your registries you can even skip the add step. General will be automatically added when you try to install a package.
5 Likes
On Julia 1.8.5 on Linux, it seems the “registry rm+add” procedure may still add the Github URL:
@v1.8) pkg> registry rm General
Removing registry `General` from ~/.julia/registries/General
(@v1.8) pkg> registry add
Installing known registries into `~/.julia`
(@v1.8) pkg> registry status
Registry Status
[23338594] General (https://github.com/JuliaRegistries/General.git)
Is it because of my ~/.julia
directory (or other) contains spoiled content from older Julia version?
I don’t think you can draw any conclusions from the output of the General registry URL. This is how it looks when you install the registry from a package server:
$ mkdir /tmp/testdepot1
$ JULIA_DEPOT_PATH=/tmp/testdepot1 julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.8.5 (2023-01-08)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
(@v1.8) pkg> registry add
Installing known registries into `/tmp/testdepot1`
(@v1.8) pkg> registry status
Registry Status
[23338594] General (https://github.com/JuliaRegistries/General.git)
and this is how it looks when you install it as a git clone from GitHub.
$ mkdir /tmp/testdepot2
$ JULIA_DEPOT_PATH=/tmp/testdepot2 JULIA_PKG_SERVER="" julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.8.5 (2023-01-08)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
(@v1.8) pkg> registry add
Installing known registries into `/tmp/testdepot2`
Cloning registry from "https://github.com/JuliaRegistries/General.git"
Added registry `General` to `/tmp/testdepot2/registries/General`
(@v1.8) pkg> registry status
Registry Status
[23338594] General (https://github.com/JuliaRegistries/General.git)
The only factor that should matter for the kind of installation is the setting of the environment variable JULIA_PKG_SERVER
. I’m not sure whether there is any fallback mechanism to git in case of a failure to reach the package server.
2 Likes