在 RHEL 7 中使用 epel 代理

在 RHEL 7 中使用 epel 代理

我正在运行 Red Hat Enterprise Linux Server 7,在让 Extra Packages for Enterprise Linux (epel) repo 正常运行时遇到了一些问题(最终我想安装 XFCE)。我认为我已经确定问题出在我的企业代理设置上。

我已经安装了 epel

wget http://dl.fedoraproject.org/pub/epel/7Server/x86_64/e/epel-release-7-9.noarch.rpm
sudo rpm -ivh epel-release-7-9.noarch.rpm

一切顺利(我已将 ~/.wgetrc 文件配置为使用我的代理设置)。但是,当我尝试执行

sudo yum repolist

我收到一个错误:“无法检索存储库的 metalink:epel/x86_64。请验证其路径并重试”而

sudo yum --disablerepo=epel repolist

运行良好。

URLGRABBER_DEBUG=1 yum repolist

让我相信这是一个代理问题,因为以下摘录:

2017-01-13 17:23:18,207 attempt 1/10: https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=x86_64
2017-01-13 17:23:18,207 opening local file "/var/tmp/yum-usernameredacted-nARLQn/x86_64/7Server/epel/metalink.xml.tmp" with mode wb
* About to connect() to mirrors.fedoraproject.org port 443 (#10)
*   Trying 209.132.181.15...
* After 14938ms connect time, move on!
*   Trying 152.19.134.142...
* After 7468ms connect time, move on!
*   Trying 209.132.181.16...
* After 3734ms connect time, move on!
*   Trying 185.141.165.254...
* After 1866ms connect time, move on!
*   Trying 174.141.234.172...
* After 932ms connect time, move on!
*   Trying 152.19.134.198...
* After 466ms connect time, move on!
*   Trying 67.219.144.68...
* After 232ms connect time, move on!
*   Trying 8.43.85.67...
* After 116ms connect time, move on!
*   Trying 140.211.169.206...
* After 58ms connect time, move on!
*   Trying 140.211.169.196...
* After 28ms connect time, move on!
*   Trying 2604:1580:fe00:0:dead:beef:cafe:fed1...
* Failed to connect to 2604:1580:fe00:0:dead:beef:cafe:fed1: Network is unreachable
*   Trying 2610:28:3090:3001:dead:beef:cafe:fed3...
* Failed to connect to 2610:28:3090:3001:dead:beef:cafe:fed3: Network is unreachable
*   Trying 2605:bc80:3010:600:dead:beef:cafe:fed9...
* Failed to connect to 2605:bc80:3010:600:dead:beef:cafe:fed9: Network is unreachable
* Failed connect to mirrors.fedoraproject.org:443; Network is unreachable
* Closing connection 10
2017-01-13 17:23:48,178 exception: [Errno 14] curl#7 - "Failed to connect to 2604:1580:fe00:0:dead:beef:cafe:fed1: Network is unreachable"
2017-01-13 17:23:48,178 retrycode (14) not in list [-1, 2, 4, 5, 6, 7], re-raising

我有 sudo 权限,但无法访问大多数 yum 配置。有什么可行的解决方案吗?

答案1

听起来您需要提供您的代理详细信息yum才能连接;

/etc/yum.conf应该添加以下行(使用您的有效代理和登录详细信息更新)。

proxy=http://<your proxy address>:<proxy port>
proxy_username=<username>
proxy_password=<password>

这是明显地存在安全隐患,因为您的配置文件中将以纯文本形式提供有效的登录凭据。任何人查看后都可以获取这些详细信息,因此请确保您了解自己的安全安排。

更多信息请参阅文档这里

如果您无法将其添加到yum.conf您的唯一真正选择是联系可以联系的人,任何其他事情都将涉及设置更多的代理和转发器,我怀疑您无论如何都无法做到这一点。

相关内容