如何为 apt-cyg 设置代理?

发布于 2024-12-11 03:40:55 字数 99 浏览 0 评论 0原文

如何为apt-cyg、http和socks设置代理? 我尝试使用

export http_proxy= 

但没有用。

How to set a proxy for apt-cyg, http and socks?
i tried using

export http_proxy= 

but it did not work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

扮仙女 2024-12-18 03:40:55

这应该有效:

export ftp_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]

This should work :

export ftp_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
勿忘初心 2024-12-18 03:40:55

您还可以将其全部添加到一行中(它与 mobaxterm 中嵌入的 cygwin/apt-get 配合良好 - 将其添加到 .bashrc):

export {ftp,http,https}_proxy=http://[user]:[passwd]@[proxy.foo.com]:[port]

You can also add it all in one line (it works well with cygwin/apt-get embedded in mobaxterm - add it to .bashrc):

export {ftp,http,https}_proxy=http://[user]:[passwd]@[proxy.foo.com]:[port]
分開簡單 2024-12-18 03:40:55

我不确定 Cygwin,但这些是我的 ~/.bashrc 中的行

export http_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export https_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export HTTP_PROXY=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export HTTPS_PROXY=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]

如果 cygwin 与 bash 类似,它应该可以工作。

I'm not sure about Cygwin, but these are the lines from my ~/.bashrc

export http_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export https_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export HTTP_PROXY=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export HTTPS_PROXY=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]

If cygwin is similar to bash, it should work.

落日海湾 2024-12-18 03:40:55

我通过设置两个 Windows 环境变量使其工作:http_proxy 和 http_proxy。我以前有 HTTP_PROXY,但没有被选中。

请注意,由于 Cygwin 是一个 Windows 进程,因此在设置新的环境变量后,您需要启动一个新的 Cygwin 进程来应用更改。

I made it work by setting two Windows environment variables: http_proxy and http_proxy. I previously had HTTP_PROXY, but that wasn't picked up.

Note that as Cygwin is a Windows process, after setting the new environment variables you need to launch a new Cygwin process to pick up the change.

请持续率性 2024-12-18 03:40:55

老问题,但似乎没有一个答案是正确的。

据我所知,尝试取消代理以在我的一台机器上运行此代理,我收到此错误:wget:无法解析主机地址“webproxystatic-mywork.com”

看起来 apt-cyg 使用 wget。所以这给你带来了这个问题: 在 wget 中设置代理

答案是:
/etc/wgetrc 中设置(或者在我的情况下取消设置)http_proxy/https_proxy

# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
#https_proxy = http://proxy.yoyodyne.com:18023/
#http_proxy = http://proxy.yoyodyne.com:18023/
#ftp_proxy = http://proxy.yoyodyne.com:18023/

# If you do not want to use proxy at all, set this to off.
#use_proxy = on

Old question, but none of the answers seem right.

From what I can tell trying to UNSET a proxy to run this on one of my boxes, I was getting this error: wget: unable to resolve host address ‘webproxystatic-mywork.com’

Looks like apt-cyg uses wget. So this brings you to this question: setting proxy in wget

The answer of which is:
set (or in my case unset) http_proxy/https_proxy in /etc/wgetrc:

# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
#https_proxy = http://proxy.yoyodyne.com:18023/
#http_proxy = http://proxy.yoyodyne.com:18023/
#ftp_proxy = http://proxy.yoyodyne.com:18023/

# If you do not want to use proxy at all, set this to off.
#use_proxy = on
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文