Rate This Document
Findability
Accuracy
Completeness
Readability

yum install Execution Timeout When a Proxy Is Required for Internet Connection

Symptom

When the server cannot be directly connected to the Internet and is connected to the Internet through a proxy, the yum install command execution times out.

Key Process and Cause Analysis

The proxy is configured using the export http_proxy=xxx command. However, Yum cannot identify the proxy.

Conclusion and Solution

  1. Add the proxy field to the /etc/yum.conf file.
    [main]
    cachedir=/var/cache/yum/$basearch/$releasever
    keepcache=0
    debuglevel=2
    logfile=/var/log/yum.log
    exactarch=1
    obsoletes=1
    gpgcheck=1
    plugins=1
    installonly_limit=5
    bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
    distroverpkg=centos-release
    sslverify=false
    http_proxy=http://127.0.0.1:3128
    HTTP_PROXY=http://127.0.0.1:3128
    https_proxy=http://127.0.0.1:3128
    HTTPS_PROXY=http://127.0.0.1:3128
    ftp_proxy=http://127.0.0.1:3128
    proxy=http://127.0.0.1:3128

    In the preceding example, 127.0.0.1 and 3128 indicate the IP address and port number of the proxy host. Replace them with the actual ones.

  2. Run the yum install command again.