Add proxy in YUM and APT-GET

Login as root

nano /etc/yum.conf

Add the proxy add the bottom of the text like:

proxy = http://proxy.domain.com:port

—————————————————————-

nano /etc/apt/apt.conf

Acquire::http::Proxy “http://MYDOMAIN\MYNAME:MYPASS@MY.PROXY.COM:MYPORT”

Advertisements

2 thoughts on “Add proxy in YUM and APT-GET

  1. Theodotos Andreou says:

    You can also add the proxy for all the cli commands that use them in the $http_proxy variable. In redhat systems:

    cat > /etc/profile.d/proxy.sh < /etc/environment << EOF
    http_proxy=http://proxy.example.com:8080
    ftp_proxy=http://proxy.example.com:8080
    HTTP_PROXY=http://proxy.example.com:8080
    FTP_PROXY=http://proxy.example.com:8080
    EOF

    This way programs like links, lynx, wget, curl and others can use these variables from env instead of defining them manually

  2. Theodotos Andreou says:

    For RedHat and derivatives:

    cat > /etc/profile.d/proxy.sh < /etc/environment << EOF
    http_proxy=http://proxy.example.com:8080
    ftp_proxy=http://proxy.example.com:8080
    HTTP_PROXY=http://proxy.example.com:8080
    FTP_PROXY=http://proxy.example.com:8080
    EOF

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s