Skip to content

Instantly share code, notes, and snippets.

@archerslaw
Last active August 29, 2015 14:04
Show Gist options
  • Save archerslaw/3d91b27799d134b6092b to your computer and use it in GitHub Desktop.
Save archerslaw/3d91b27799d134b6092b to your computer and use it in GitHub Desktop.
Using yum with a Proxy Server.
1.Refer to the man page for yum.conf for information on HTTP settings that may be modified for compatibility with nonstandard web proxy servers.
2.Configuring Proxy Server Access
To enable all yum operations to use a proxy server, specify the proxy server details in /etc/yum.conf. The proxy setting must specify the proxy server as a complete URL, including the TCP port number. If your proxy server requires a username and password, specify these by adding proxy_username and proxy_password settings.
e.g.:http://squid.corp.redhat.com:3128
# vim /etc/yum.conf
# The proxy server - proxy server:port number
proxy=http://URL:PORT
# The account details for yum connections(optional)
proxy_username=YOUR-PROXY-USERNAME
proxy_password=YOUR-PROXY-PASSWORD
...
3.Configuring Proxy Server Access for a Single User.
To enable proxy access for a specific user, add the lines in the example box below to the user's shell profile.
# The Web proxy server used by this account
http_proxy="http://URL:PORT"
export http_proxy
OR # cat /etc/profile.d/proxy.sh
export http_proxy="squid.corp.redhat.com:3128"
export ftp_proxy="squid.corp.redhat.com:3128"
export HTTP_PROXY="squid.corp.redhat.com:3128"
export FTP_PROXY="squid.corp.redhat.com:3128"
export no_proxy=".localdomain.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment