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 was taking forever. So, I tried to add BenchmarkTools by directly specifying its repository address. Then I get the following message:
(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:
$ 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:
$ 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?