通过代理使用 yum

问题描述 投票:0回答:2

我正在尝试将 yum 与代理一起使用,但是当我这样做时:

yum list

我得到:

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: HTTP Error 407 - Proxy Authentication Required ...

为了配置 yum,我尝试了两种解决方案:

  1. 在/etc/yum.conf中添加:
    proxy=http://username:password@yourproxy:8080/
  2. 和:
    export http_proxy=http://username:password@yourproxy:8080/

但是当我导出变量时,curl 就起作用了。

操作系统:

CentOS Linux release 7.5.1804 (Core)

PS1:代理是在Windows下,即使curl工作,问题是否可能是NTLM?

PS2:我们正在使用另一个代理,现在它可以工作了。

proxy centos yum
2个回答
0
投票

第一个应该可以工作。这就是我正在使用的

 proxy=http://webproxy.company.com:3128/

您确定您的代理正在侦听 8080 吗?这对于代理服务器来说似乎是一个奇怪的端口。


0
投票

当您使用第二种方法时,您将在当前配置文件上设置代理,因此当您使用时

须藤百胜----

您没有使用您设置的代理。 只需从您使用命令的同一配置文件中导出代理即可。

© www.soinside.com 2019 - 2024. All rights reserved.