Ask Your Question

Proxy Internet & Terminal

asked 2012-01-03 09:27:02 -0500

Chetan Patil gravatar image

I have my netconnection via proxy with username and password.

I am able to browse using browser however not able to use internet via terminal for yum,wget etc.

Prosy settings is like :

Any solution?

edit retag flag offensive close merge delete

5 Answers

Sort by » oldest newest most voted

answered 2012-01-03 09:58:28 -0500

hhlp gravatar image

updated 2012-01-04 11:11:08 -0500

for WGET

editing sudo vim /etc/wgetrc and edited the following:

# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
#https_proxy =
#http_proxy =
#ftp_proxy =

# If you do not want to use proxy at all, set this to off.
#use_proxy = on

You need to remove the comment (#) at the beginning of the last 4 lines shown here.

for YUM

we are going to configure YUM software to use proxy to get LINUX updated with new softwares all the times with repositories available on internet.

1) Configure yum.conf

sudo vim /etc/yum.conf

enter following lines at bottom of [main] section


2) Open a Terminal and Export http_proxy variable

export http_proxy=”http://yourproxyaddress:port/”
export ftp_proxy=”http://yourproxyaddress:port/”

3) Export http_proxy variable in bash login script

gedit /home/<username>/.bashrc_profile &

export http_proxy=”http://yourproxyaddress:port/”
export ftp_proxy=”http://yourproxyaddress:port/”

This will help you to export http_proxy variable automatically everytime you login.

Now use “yum list” command to check for its working.

yum list


man yum.conf

edit flag offensive delete link more

answered 2012-01-04 12:09:49 -0500

asto gravatar image

If you want to do everything through a proxy, rather than setup proxies for individual software packages, I would recommend changing the global settings. Open up "gnome-control-center" from the terminal, go to network settings and edit the proxy configuration there.

edit flag offensive delete link more


I tested both method in a virtual machine with an free proxy server port 80 and both method work perfectly of course @asto method is the esiest...

hhlp gravatar imagehhlp ( 2012-01-04 13:04:15 -0500 )edit

answered 2012-01-03 09:52:38 -0500

SoumyaC gravatar image

Check the link below if that helps -

Yum under proxy

edit flag offensive delete link more

answered 2014-05-05 08:32:45 -0500

linux.alder gravatar image

If you are using a system in an environment that requires username & password (which should change regularly). You can use this. I place it in my .bashrc file. Replacing the PROXYSERVER:PORT with the on that is appropriate for your environment.

Open a new shell, type "proxy" and it will ask for the username and a (non-echoed) password. I ask for the username as my systems are in a shared-user environment as well. This has worked for yum, wget and everything else I have tried so far.

function proxy(){
echo -n "username: "
read -e username
echo -n "password: "
read -es password
export http_proxy="http://$username:$password@PROXYSERVER:PORT"
export ftp_proxy="http://$username:$password@PROXYSERVER:PORT"
export HTTP_PROXY="http://$username:$password@PROXYSERVER:PORT"
export FTP_PROXY="http://$username:$password@PROXYSERVER:PORT"
edit flag offensive delete link more

answered 2012-03-22 22:03:08 -0500

RDKcodes gravatar image

I have no proxy for my network. I set the network settings to automatic.

Now what do I export http_proxy= to?

As, I have no proxy, it should probably be http_proxy="No Proxy"(something like that).

The CPAN should also be configured using o conf, what should I set the network to here ?

edit flag offensive delete link more

Question Tools



Asked: 2012-01-03 09:27:02 -0500

Seen: 30,930 times

Last updated: May 05 '14