I have to use a http proxy to access Internet. Now I'm using firefox with the http proxy to access Internet. But on terminal, I can' access Internet.

So are there ways to use http proxy on terminal so I can access Internet? THanks!

My linux is fedora 16

I tried

[root@kitty wg]# http_proxy =http://proxy.polito.it:8080
bash: http_proxy: command not found...
  • Irix, HP-UX, Linux, AIX, Solaris,...?
    – Jan
    Commented Oct 16, 2014 at 8:28
  • @Jan it is fedora
    – lily
    Commented Oct 16, 2014 at 8:34
  • Fedora 16 is EOL(End of Life). So time to upgrade! Commented Oct 16, 2014 at 8:37
  • @val0x00ff does version matter? I' just want to use proxy
    – lily
    Commented Oct 16, 2014 at 8:50

2 Answers 2


Jan's answer is good, the environment variable http_proxy is read by many programs, e.g. wget. You can add this

export http_proxy="http://@${proxyserver}:${port}"

to your ~/.bash_profile. Also yum works, but you can also specify it in /etc/yum.conf.

Other programs can be configured similarly (e.g. git in ~/.gitconfig, chromium --proxy-server=host:port).

Some programs do not read this environment variable, e.g. svn. You need to proxify them. This works by replacing shared network libraries with proxified versions, which route traffic through the proxy. E.g. proxychains or tsocks.

Your best source for each program is to open the manual and search for proxy.

btw, the reason your own attempt failed, was that you must not use a space between http_proxy and =.., otherwise you cannot declare that variable (bash thinks it is a command, but doesn't find a matching one in your $PATH.).


Yuo need to export the following environment variables:

  • how to do this? I tried something like export http_proxy='http://user:pass@PROXY_IP:PROXY_PORT/' as command line, but it doesn't work
    – lily
    Commented Oct 16, 2014 at 10:03
  • Just to make sure: you did put in your proxy user and pass, did you? Please open a new question to let us find the cause, be sure to include the actual error message or description, "it doesnt work" is no error message.
    – Jan
    Commented Oct 16, 2014 at 10:12
  • no username/passwd is needed for this proxy. ”It doesn't work“ means I still can't access Internet, for example, ping fails.
    – lily
    Commented Oct 16, 2014 at 10:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .