# Error adding package from local registry: , Class:SSH, failed to set hostkey preference

**URL:** https://discourse.julialang.org/t/error-adding-package-from-local-registry-class-ssh-failed-to-set-hostkey-preference/130183
**Category:** General Usage
**Tags:** package, registry
**Created:** [June 24, 2025, 8:38pm UTC](https://discourse.julialang.org/t/error-adding-package-from-local-registry-class-ssh-failed-to-set-hostkey-preference/130183 "2025-06-24T20:38:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)
#### Post date: [June 24, 2025, 8:38pm UTC](https://discourse.julialang.org/t/error-adding-package-from-local-registry-class-ssh-failed-to-set-hostkey-preference/130183/1 "2025-06-24T20:38:43Z")

</div>

I’ve been working with a local registry on a Windows computer for a while. After an update, I receive the following error:

```julia
(Environment) pkg> add TrueAndErrorModels
   Resolving package versions...
     Cloning [260ba6b7-9af7-473a-b238-1a1a0638f266] TrueAndErrorModels from git@github.com:itsdfish/TrueAndErrorModels.jl.git
ERROR: failed to clone from git@github.com:itsdfish/TrueAndErrorModels.jl.git, error: GitError(Code:ERROR, Class:SSH, failed to set hostkey preference: The requested method(s) are not currently supported)

```

I’m not sure if its related to the update, but I am unsure how to resolve the issue. Any help would be appreciated.

---

<div class="post-metadata">

### Author: ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)
#### Post date: [June 24, 2025, 9:21pm UTC](https://discourse.julialang.org/t/error-adding-package-from-local-registry-class-ssh-failed-to-set-hostkey-preference/130183/2 "2025-06-24T21:21:23Z")

</div>

It seems like the issue is that its cloning via [git@github.com](mailto:git@github.com):itsdfish/TrueAndErrorModels.jl.git rather the https. I switched it from https a while back because it stopped working. I’m not sure why the behavior has changed.

---

<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: [June 24, 2025, 9:33pm UTC](https://discourse.julialang.org/t/error-adding-package-from-local-registry-class-ssh-failed-to-set-hostkey-preference/130183/3 "2025-06-24T21:33:20Z")

</div>

I don’t think I’ve understood the situation exactly, but

- The choice between the git and https protocols primarily depends on which URL is in the registry.
- If you intend to use the git protocol and have unexpected authorization problems, try setting the environment variable `JULIA_PKG_USE_CLI_GIT=true`.

---

<div class="post-metadata">

### Author: ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)
#### Post date: [June 24, 2025, 9:42pm UTC](https://discourse.julialang.org/t/error-adding-package-from-local-registry-class-ssh-failed-to-set-hostkey-preference/130183/4 "2025-06-24T21:42:10Z")

</div>

Thank you for the reply. To be honest, I don’t quite understand the situation. I started with using [GitHub - itsdfish/TrueAndErrorModels.jl](https://github.com/itsdfish/TrueAndErrorModels.jl.git). When that stopped working for an unknown reason, I switched to [git@github.com](mailto:git@github.com):itsdfish/TrueAndErrorModels.jl.git, which worked for about a year until I received the error above. I switched back to the http procol and now it works. I’ll see if I can trace it back to a change in JULIA\_PKG\_USE\_CLI\_GIT. Thanks for the hint!
