在 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您唯一真正的選擇是聯繫可以的人,那麼更多的事情將涉及設置更多的代理和轉發器,我懷疑您無論如何也做不到。

相關內容