English
Ask Your Question
1

Proxy Internet & Terminal

asked 2012-01-03 15:27:02 +0000

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 : pqr.abc.def.ghi:80

Any solution?

edit retag flag offensive close merge delete

5 answers

Sort by » oldest newest most voted
4

answered 2012-01-03 15:58:28 +0000

hhlp gravatar image

updated 2012-01-04 17:11:08 +0000

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.yoyodyne.com:18023/
#http_proxy = http://proxy.yoyodyne.com:18023/
#ftp_proxy = http://proxy.yoyodyne.com:18023/

# 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

proxy=http://yourproxyaddress:port/
proxy_username=youruser
proxy_password=yourpassword

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

Documentation

man yum.conf

edit flag offensive delete link more
3

answered 2012-01-04 18:09:49 +0000

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

Comments

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 ( 2012-01-04 19:04:15 +0000 )edit
0

answered 2012-03-23 03:03:08 +0000

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
0

answered 2014-05-05 13:32:45 +0000

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"
echo
}
edit flag offensive delete link more
0

answered 2012-01-03 15:52:38 +0000

Check the link below if that helps -

Yum under proxy

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

Follow
2 followers

Stats

Asked: 2012-01-03 15:27:02 +0000

Seen: 16,778 times

Last updated: May 05 '14