# Updating a Local Registry

**URL:** <https://discourse.julialang.org/t/updating-a-local-registry/73401>\
**Category:** Package Management\
**Created:** [December 20, 2021, 7:53pm UTC](https://discourse.julialang.org/t/updating-a-local-registry/73401 "2021-12-20T19:53:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TI36XPro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ti36xpro/32/33658_2.png) [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Post date:** [December 20, 2021, 7:53pm UTC](https://discourse.julialang.org/t/updating-a-local-registry/73401/1 "2021-12-20T19:53:36Z")

</div>

Hello,

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

I followed the instructions [here](https://discourse.julialang.org/t/sharing-pluto-nbs-with-custom-modules/72962/7) 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

```julia
    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](https://github.com/GunnarFarneback/LocalRegistry.jl/blob/master/docs/ssh_keys.md) 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](https://github.com/GunnarFarneback/LocalRegistry.jl/blob/master/docs/ssh_keys.md)

```julia
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](https://github.com/GunnarFarneback/LocalRegistry.jl/blob/master/docs/ssh_keys.md) and just add it to my github account (so I will have two ssh keys associated with it)?

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [December 20, 2021, 8:26pm UTC](https://discourse.julialang.org/t/updating-a-local-registry/73401/2 "2021-12-20T20:26:30Z")

</div>

> [@TI36XPro](#):
>
> Looking [here](https://github.com/GunnarFarneback/LocalRegistry.jl/blob/master/docs/ssh_keys.md) 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?

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

> [@TI36XPro](#):
>
> I also tried setting the following in my `.bashrc` per [here](https://github.com/GunnarFarneback/LocalRegistry.jl/blob/master/docs/ssh_keys.md)
> 
> ```julia
> 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` .

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

> [@TI36XPro](#):
>
> So, should I:
> 
> - Somehow reformat my existing ssh key so it is in a compatible format?
> - Create a new key using the instructions [here](https://github.com/GunnarFarneback/LocalRegistry.jl/blob/master/docs/ssh_keys.md) and just add it to my github account (so I will have two ssh keys associated with it)?

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`.

---

<div class="post-metadata">

**Author:** ![TI36XPro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ti36xpro/32/33658_2.png) [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Post date:** [December 28, 2021, 5:33am UTC](https://discourse.julialang.org/t/updating-a-local-registry/73401/3 "2021-12-28T05:33:44Z")

</div>

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

```julia
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?

---

<div class="post-metadata">

**Author:** ![TI36XPro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ti36xpro/32/33658_2.png) [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Post date:** [December 28, 2021, 5:54am UTC](https://discourse.julialang.org/t/updating-a-local-registry/73401/4 "2021-12-28T05:54:32Z")

</div>

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.
