# Alternative URLs for one package in a Registry

**URL:** <https://discourse.julialang.org/t/alternative-urls-for-one-package-in-a-registry/102500>\
**Category:** General Usage\
**Tags:** pkg, registry\
**Created:** [August 4, 2023, 6:56pm UTC](https://discourse.julialang.org/t/alternative-urls-for-one-package-in-a-registry/102500 "2023-08-04T18:56:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [August 4, 2023, 6:56pm UTC](https://discourse.julialang.org/t/alternative-urls-for-one-package-in-a-registry/102500/1 "2023-08-04T18:56:07Z")

</div>

Can a Registry store multiple (alternative) URLs for the same package? The assumption being that all the URLs have the same content but Pkg should try the next one if one fails.

The motivation is to store both HTTPS and SSH in the repo field, so that a user can access a private package using the authentication method that works for them.

A poor man’s solution is to have two registries, one with HTTPs URLs and another with SSH. But hopefully, there is a better way.

Bonus points if this can be done with LocalRegistry.jl.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [August 4, 2023, 9:41pm UTC](https://discourse.julialang.org/t/alternative-urls-for-one-package-in-a-registry/102500/2 "2023-08-04T21:41:47Z")

</div>

No, but see this 4 year old PR: [Allow for multiple repo urls in Package.toml by fredrikekre · Pull Request #1060 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/1060) (unlikely to be merged though).

I would suggest you tell Pkg to use system `git` (set the env variable `JULIA_PKG_USE_CLI_GIT` to `true`) and use `insteadOf` in the git config.

---

<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:** [August 4, 2023, 9:45pm UTC](https://discourse.julialang.org/t/alternative-urls-for-one-package-in-a-registry/102500/3 "2023-08-04T21:45:40Z")

</div>

At work we work around this issue by serving the private packages with [GitHub - GunnarFarneback/LocalPackageServer.jl: Julia storage and package server for local packages.](https://github.com/GunnarFarneback/LocalPackageServer.jl)

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [August 4, 2023, 10:40pm UTC](https://discourse.julialang.org/t/alternative-urls-for-one-package-in-a-registry/102500/4 "2023-08-04T22:40:18Z")

</div>

> [@fredrikekre](#):
>
> I would suggest you tell Pkg to use system `git` (set the env variable `JULIA_PKG_USE_CLI_GIT` to `true`) and use `insteadOf` in the git config.

This works.
