Updating a Local Registry


I am trying to update a local registry but am unsure how to proceed and would appreciate advice.

I followed the instructions here for creating my own private registry for sharing with collaborators. I have a repo that contains my private registry TestRegistry and a separate repo that contains my package TestPackage.

To test it, I created a new environment, entered the Pkg interface, and typed add TestPackage.

The terminal then spat out

    Updating registry at `~/.julia/registries/General`
    Updating registry at `~/.julia/registries/TestRegistry`
    Updating git-repo `https://github.com/MyUserName/TestRegistry`

Then it prompted me for a github username and password. Well I didn’t enter it because I am pretty sure github moved away from username/password type authentication and uses ssh keys. I already have a private SSH key linked to my github. Looking here it seems I need a specific key format which mine is not - is that right? Would that explain why I get prompted for my github username/password?

I also tried setting the following in my .bashrc per here

export SSH_PUB_KEY_PATH=~/.ssh/key.pub
export SSH_KEY_PATH=~/.ssh/key

But I still get prompted for my github username/password when trying to add TestPackage. So, should I:

  • Somehow reformat my existing ssh key so it is in a compatible format?
  • Create a new key using the instructions here and just add it to my github account (so I will have two ssh keys associated with it)?

Yes, that’s the typical symptom of having a key in the newer format which libssh2 doesn’t understand.

That’s normal. Despite the error message, actually finding the key is rarely the problem.

If you find a way to reformat your existing ssh key I’m interested in adding it to my documentation. (I have never investigated whether this is possible or not.)

Creating a new key in the right format should work fine.

However, with Julia 1.7 you also have the option of using command-line git for Pkg operations, which may be a more convenient solution. Enable this by setting the environment variable JULIA_PKG_USE_CLI_GIT=true.


I think I am almost there. I think the problem I have now is that when I registered TestPackage with TestRegistry, the git repo was set up to use HTTPS. I have switched both TestPackage and TestRegistry to use ssh (I can verify using git remote show origin). It appears to have gotten me a bit farther because now I get

Updating registry at `~/.julia/registries/General`
Updating registry at `~/.julia/registries/TestRegistry`
Updating git-repo `git@github.com:MyUserName/TestRegistry`
Resolving package versions...
Updating git-repo `https://github.com/MyUserName/TestPackage.jl`

After which it prompts me for my github password.

Any thoughts on what I need to change to get it across the finish line?

Nevermind - It’s late and I think I was trying to activate something that wasn’t a julia environment (i.e. didn’t contain any .toml files. I just activated the correct environment and now I can add TestPackage without any issues or prompting of passwords.

A side note - I had to manually add the RSA fingerprint for github otherwise I got a warning about a potential man-in-the-middle attack.