# Cannot add packages (maybe due to corporate firewall?)

**URL:** https://discourse.julialang.org/t/cannot-add-packages-maybe-due-to-corporate-firewall/19352
**Category:** General Usage
**Created:** [January 7, 2019, 3:21pm UTC](https://discourse.julialang.org/t/cannot-add-packages-maybe-due-to-corporate-firewall/19352 "2019-01-07T15:21:24Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)
#### Post date: [January 7, 2019, 3:21pm UTC](https://discourse.julialang.org/t/cannot-add-packages-maybe-due-to-corporate-firewall/19352/1 "2019-01-07T15:21:25Z")

</div>

I have successfully built Julia 1.2 on my work computer (macOS 10.14.2 Mojave), but cannot add packages. These are the messages I get:

```julia
julia> VERSION
v"1.2.0-DEV.93"

(v1.2) pkg> add BenchmarkTools
   Cloning default registries into `~/.julia`
   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:OS, failed to connect to github.com: Operation timed out)

```

I thought this might be due to the corporate firewall, so I tried the trick described in [https://github.com/JuliaLang/julia/issues/20948#issuecomment-287306113](https://github.com/JuliaLang/julia/issues/20948#issuecomment-287306113) to add the proxy settings to `~/.gitconfig`. I also tried to let Git to use `https` instead of `git` by following [https://github.com/JuliaLang/julia#source-download-and-compilation](https://github.com/JuliaLang/julia#source-download-and-compilation). Still unsuccessful.

Any suggestions?

---

<div class="post-metadata">

### Author: ![Ajaychat3](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@Ajaychat3](https://discourse.julialang.org/u/Ajaychat3)
#### Post date: [January 7, 2019, 4:04pm UTC](https://discourse.julialang.org/t/cannot-add-packages-maybe-due-to-corporate-firewall/19352/2 "2019-01-07T16:04:48Z")

</div>

I use win 10 and have a workaround to install packages.  
For this you should to be able to reset IE settings in internet options- Advanced tab. If this is possible, reset the setting and after that you can connect to the any wifi network and install packages.

To come back to corporate network, restart you computer or just log off and log in and it should work.

---

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [January 7, 2019, 7:05pm UTC](https://discourse.julialang.org/t/cannot-add-packages-maybe-due-to-corporate-firewall/19352/3 "2019-01-07T19:05:26Z")

</div>

> [@Ajaychat3](#):
>
> If this is possible, reset the setting

My corporate admin blocked this. R can install flawless from behind firewalls most of the time so maybe also need to look at their approach. Unfortunate, I have 0 knowledge of networking so have gave up installing Julia at work…

---

<div class="post-metadata">

### Author: ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)
#### Post date: [January 7, 2019, 7:39pm UTC](https://discourse.julialang.org/t/cannot-add-packages-maybe-due-to-corporate-firewall/19352/4 "2019-01-07T19:39:32Z")

</div>

More information about the problem. According to my original posting, it seemed that cloning the registry from [GitHub - JuliaRegistries/General: The official registry of general Julia packages](https://github.com/JuliaRegistries/General.git) was taking forever. So, I tried to add `BenchmarkTools` by directly specifying its repository address. Then I get the following message:

```julia
(v1.2) pkg> add https://github.com/JuliaCI/BenchmarkTools.jl.git
   Cloning git-repo `https://github.com/JuliaCI/BenchmarkTools.jl.git`
ERROR: failed to clone from https://github.com/JuliaCI/BenchmarkTools.jl.git, error: GitError(Code:ERROR, Class:OS, failed to connect to github.com: Operation timed out)

```

Again, cloning the Git repository for `BenchmarkTools` takes forever. This is strange, though, because in the terminal I can `git clone https://github.com/JuliaCI/BenchmarkTools.jl` with no problem:

```bash
$ git clone https://github.com/JuliaCI/BenchmarkTools.jl
Cloning into 'BenchmarkTools.jl'...
remote: Enumerating objects: 1230, done.
remote: Total 1230 (delta 0), reused 0 (delta 0), pack-reused 1230
Receiving objects: 100% (1230/1230), 310.90 KiB | 1.16 MiB/s, done.
Resolving deltas: 100% (815/815), done.

```

So, it seems that the proxy settings are actually working for Git; it is just that Julia does not recognize these settings for some reason. This is weird, because `ENV["http_proxy"]`and `ENV["https_proxy"]` in the Julia REPL show the correct proxy information specified in my `.bashrc`.

To further verify my theory that the proxy settings for Git are correct but Julia does not recognize them properly, I tried to remove the proxy information in `.bashrc` by commenting the `export http_proxy=...` and `export https_proxy=...` lines. Then, I was no longer able to `git clone` in the terminal. Here is the result of the same command as above:

```bash
$ git clone https://github.com/JuliaCI/BenchmarkTools.jl
Cloning into 'BenchmarkTools.jl'...
fatal: unable to access 'https://github.com/JuliaCI/BenchmarkTools.jl/': Failed to connect to github.com port 443: Operation timed out

```

As you can see, the error message is nearly the same as the one I got from `pkg> add https://github.com/JuliaCI/BenchmarkTools.jl.git` in the Julia REPL. This means Julia was indeed complaining that it could not see the proxy settings (even though they were set in `.bashrc`).

Any suggestions?

---

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [January 7, 2019, 8:15pm UTC](https://discourse.julialang.org/t/cannot-add-packages-maybe-due-to-corporate-firewall/19352/5 "2019-01-07T20:15:26Z")

</div>

Thanks for the investigation. This is awesome. I also tried to capitalise to HTTP(S)\_PROXY but it also didn’t work. And I can confirm that I can clone using Git as well.

---

<div class="post-metadata">

### Author: ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)
#### Post date: [January 7, 2019, 8:38pm UTC](https://discourse.julialang.org/t/cannot-add-packages-maybe-due-to-corporate-firewall/19352/6 "2019-01-07T20:38:48Z")

</div>

I just reported this issue at [Update problems with corporate proxy with user and pass · Issue #20948 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/20948#issuecomment-452073028).

---

<div class="post-metadata">

### Author: ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)
#### Post date: [January 7, 2019, 9:31pm UTC](https://discourse.julialang.org/t/cannot-add-packages-maybe-due-to-corporate-firewall/19352/7 "2019-01-07T21:31:03Z")

</div>

Separate issue filed: [https://github.com/JuliaLang/julia/issues/30635](https://github.com/JuliaLang/julia/issues/30635).
