英文:
Unable `go get` a repository via an HTTP proxy
问题
当我尝试安装Burrow时,遇到了以下错误:
package gopkg.in/gcfg.v1: unrecognized import path "gopkg.in/gcfg.v1"
(https fetch: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused)
我已经通过以下方式设置了代理:
export http_proxy=myproxy:port
export https_proxy=myproxy:port
编辑:
执行以下命令:
go get -u gopkg.in/gcfg.v1
同样出现了相同的错误:
package gopkg.in/gcfg.v1: unrecognized import path "gopkg.in/gcfg.v1"
(https fetch: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused)
编辑1:
执行以下命令:
go get -v gopkg.in/gcfg.v1
出现了以下错误信息:
Fetching https://gopkg.in/gcfg.v1?go-get=1
https fetch failed: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused
package gopkg.in/gcfg.v1: unrecognized import path "gopkg.in/gcfg.v1" (https fetch: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused)
以上是要翻译的内容。
英文:
When I am trying to install Burrow https://github.com/linkedin/Burrow#build-and-install
go get github.com/linkedin/Burrow
I am getting the following error :
package gopkg.in/gcfg.v1: unrecognized import path "gopkg.in/gcfg.v1"
(https fetch: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused)
I have already set up proxy by:
export http_proxy=myproxy:port
export https_proxy=myproxy:port
Edit:
go get -u gopkg.in/gcfg.v1
also gives the same error:
package gopkg.in/gcfg.v1: unrecognized import path "gopkg.in/gcfg.v1"
(https fetch: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused)
Edit1:
go get -v gopkg.in/gcfg.v1
Fetching https://gopkg.in/gcfg.v1?go-get=1
https fetch failed: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused
package gopkg.in/gcfg.v1: unrecognized import path "gopkg.in/gcfg.v1" (https fetch: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused)
答案1
得分: 3
我也遇到了同样的错误。原来是我的https代理设置不正确。请确保http和https代理都指向以http开头的同一个代理。
export http_proxy=<http://proxy:port>
export https_proxy=<http://proxy:port>
英文:
I was also getting the same error. Turns out that my https proxy was incorrect. Make sure both http and https proxy are pointing to same proxy starting with http.
export http_proxy=<http://proxy:port>
export https_proxy=<http://proxy:port>
答案2
得分: 1
从您的计算机中删除环境变量HTTPS_PROXY的步骤如下:
-
打开系统属性 - 环境变量 - 当前用户变量/系统变量:找到并删除HTTPS_PROXY。
-
重新启动终端以使环境变量修改生效。
英文:
Remove env HTTPS_PROXY from your PC:
-
SystemProperty - Environment - current user variable/system variable : find and remove HTTPS_PROXY.
-
Restart your terminal to enable env modification to take effect.
答案3
得分: -1
我使用以下方法解决了这个问题:
export https_proxy=$http_proxy
为了找到一个更持久的解决方案,可以更新 /etc/environment 文件。
英文:
I solved the problem using:
export https_proxy=$http_proxy
To a more long lasting solution the /etc/environment can be updated.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论