# "Offline" Installation Packages via Proxy

**URL:** https://discourse.julialang.org/t/offline-installation-packages-via-proxy/88656
**Category:** New to Julia
**Tags:** question
**Created:** [October 13, 2022, 11:58am UTC](https://discourse.julialang.org/t/offline-installation-packages-via-proxy/88656 "2022-10-13T11:58:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![coffee](https://avatars.discourse-cdn.com/v4/letter/c/dc4da7/32.png) [@coffee](https://discourse.julialang.org/u/coffee)
#### Post date: [October 13, 2022, 11:58am UTC](https://discourse.julialang.org/t/offline-installation-packages-via-proxy/88656/1 "2022-10-13T11:58:51Z")

</div>

Hello, everyone

I am new to julia. Is it possible, to use julia (v1.7.3) offline and also take the advantages from the package management? I am able to get some stuff from github by an other url (mirror-server/proxy), but i can’t reach either `github.com` or `pkg.julialang.org` directly.  
In this case, i want to get `https://github.com/quinnj/MusicAlbums.jl` and resolve the deps in the project.toml.

(Sorry for strange links, but i got an error “new users can only put 2 links in a post.”)

PROXYURL replaces the long URL of the proxy/mirrorserver.

```julia
(@v1.7) pkg> dev https://PROXYURL/quinnj/MusicAlbums.jl
  Installing known registries into `~/.julia`
┌ Warning: could not download https://pkg.julialang.org/registries
│ exception = Could not resolve host: pkg.julialang.org while requesting https://pkg.julialang.org/registries
└ @ Pkg.Registry /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/Pkg/src/Registry/Registry.jl:82
┌ Warning: could not download https://pkg.julialang.org/registries
│ exception = Could not resolve host: pkg.julialang.org while requesting https://pkg.julialang.org/registries
└ @ Pkg.Registry /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/Pkg/src/Registry/Registry.jl:82
     Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: failed to clone from https://github.com/JuliaRegistries/General.git, error: GitError(Code:ERROR, Class:Net, failed to resolve address for github.com: Name or service not known)

```

This doesnt also work for me:

```julia
(@v1.7) pkg> registry add https://PROXYURL/JuliaRegistries/General
     Cloning registry from "https://PROXYURL/JuliaRegistries/General"
ERROR: failed to clone from https://PROXYURL/JuliaRegistries/General, error: GitError(Code:ERROR, Class:HTTP, unexpected http status code: 404

```

)

The connection from the os cli (ubuntu 20.04) looks fine:

```julia
coffee@server:~$ curl -XGET https://PROXYURL/JuliaRegistries/General
[ {
  "name" : "KristofferC-patch-1",
  "commitId" : "774d78ebe8bd699bc96396531064a3253370e03b",
  "isBranch" : true
}, {
  "name" : "kc/consistent_spacing",
  "commitId" : "035140a7c8b5e6b2a19043c73f925204a408f19c",
  "isBranch" : true
}, {
  "name" : "kc/statistics_compat",
  "commitId" : "72ee85d3ece15d1d562938c70d2ab98d3a95d411",
  "isBranch" : true
[....]

```

I’m searching for a comfortable way, not the “transfer via usb-stick” way 🙂  
So far I’ve only found “copy solutions”.

Do you have any ideas?

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [October 13, 2022, 1:01pm UTC](https://discourse.julialang.org/t/offline-installation-packages-via-proxy/88656/2 "2022-10-13T13:01:19Z")

</div>

I believe [GitHub - GunnarFarneback/LocalRegistry.jl: Create and maintain local registries for Julia packages.](https://github.com/GunnarFarneback/LocalRegistry.jl)

is for that exactly, but I’ve not looked much into it. Because this is a problem I, and think most users, don’t have (unless in China, or behind company firewall, can also suggest opening it), so maybe not well known. Maybe it should be documented in Julia’s docs, if it isn’t already. I suggest you make a doc PR… except I see `github.com` is blocked for you. 🙂

> [@coffee](#):
>
> Is it possible, to use julia (v1.7.3) offline

Yes, though I suggest the supported 1.8.2 (both have same limitations in this regard). Julia itself doesn’t have a problem with offline (or e.g. compiled to binaries), just Pkg of it (e.g. in REPL). One other workaround might be to copy .julia folder with installed packages from some other computer that did have access. This would usually work, though if Julia compiles packages to native code already (I think it does), it might be a problem if the other computer is newer (or e.g. different arch, say ARM).

---

<div class="post-metadata">

### Author: ![coffee](https://avatars.discourse-cdn.com/v4/letter/c/dc4da7/32.png) [@coffee](https://discourse.julialang.org/u/coffee)
#### Post date: [October 20, 2022, 7:21am UTC](https://discourse.julialang.org/t/offline-installation-packages-via-proxy/88656/3 "2022-10-20T07:21:11Z")

</div>

I tried your suggestion, but it also fails: `ERROR: failed to clone from https://github.com/JuliaRegistries/General.git`

You are right, it’s a company Firewall 😉  
Github ist only blocked when I access it via `https://github.com/Julia....`. Instead I have to use `https://PROXYURL/ANOTHERSTUFF/Julia....`, which works fine (see curl in first post). I thought, that i can add my own registry or change the default-github-URL by edit files like `./julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/Registry/Registry.jl` and replace the string. But somehow nothing works for me.

Copying the .julia directory here is a bigger hassle that I wanted to avoid.  
If no one else has an idea, I guess that’s the only option.

---

<div class="post-metadata">

### Author: ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)
#### Post date: [October 20, 2022, 7:28am UTC](https://discourse.julialang.org/t/offline-installation-packages-via-proxy/88656/4 "2022-10-20T07:28:19Z")

</div>

I wonder about these somehow strange proxy setting. Are you sure, that the typically settting of environment variables `http_proxy`, `https_proxy`, … doesn’t work?  
Because with the need to change the URL every application which does something on the network would fail. Not that this isn’t very common these days.

Do you need any help about setting `http_proxy`, `https_proxy`?
