Running a Linux box and using “yum” command behind a proxy that requires authentication is really painful, you will need to make some configuration to get full internet access. Let me explain you how to get rid of it. First, Open your terminal and add these lines (given below) to the “.bashrc” file. It will set proxy for wget, http, https and ftp access.
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.
1 2 3 | # vi /etc/yum.conf |
1 2 3 4 5 6 7 | # The proxy server - proxy server:port number proxy=http://:@: # The account details for yum connections proxy_username=yum-user proxy_password=qwerty |
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. For the default bash shell, the profile is the file ~/.bash_profile.
1 2 3 | $ vi ~/.bash_profile |
1 2 3 4 5 | # The Web proxy server used by this account http_proxy="http://:" export http_proxy |
Profile Settings for Using a Proxy Server If the proxy server requires a username and password, add these to the URL. To include the username yum-user and the password qwerty, add these settings:
1 2 3 4 5 | # The Web proxy server, with the username and password for this account http_proxy="http://http://:@:" export http_proxy |
NOTE: This is really insecure as you will now have your proxy user id and password simple readable text format.