How to enable Proxy Settings for Yum Command on RHEL / CentOS Servers

8 Responses

  1. Juliette says:


    Thanks for your help, but I still have a bad issue when I try to execute yum.
    I configure my /etc/environment like you, try “yum update”
    and now, (as always, before my configuration), I have this error :

    There was an error communicating with RHN.
    Red Hat Satellite or RHN Classic support will be disabled.
    Error communicating with server. The message was:
    Unable to connect to the host and port specified
    [[email protected] etc]$

    • Hi Juliette,

      First set the proxy variables on the terminal and then try executing the commands, If you wan to use ‘/etc/environment’ file then you have to first source the file using the command:

      # source /etc/environment

  2. Aymaliev says:

    Best tutorial out there. Thank you

  3. mosi says:

    Hi, My CentOS Server is running on virtualbox, I run privoxy and make a http proxy on port 8118, then set the proxy in yum.conf file like this:
    This is my main OS ip, but I see “Connection refused …” errro
    with foxyproxy on firefox I am connected with same details , please help

  4. Simone says:

    I’m not sure the ‘#’ in the password without escaping will be accepted by your system without commenting everything after.

  5. James says:

    In the /etc/environment or root/bash.rc examples how would you account for a domain designation such as “domainname\username”

    http_proxy=http://domain\username:[email protected]:80 does not seem to work.

    In the yum.conf example it works because I can specify the username as a variable… Any advice would be greatly appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *