Setting http_proxy value to local bashrc file

When I connect my laptop to internet from my institute I had to connect it through proxy. But when I connect it from my room I have to connect it directly. So I have to change my proxy frequently.
But I have observed that changing proxy through network manager does not actually change the value of "http_proxy" variable. Neither the export command actually work. So we have changed the value by changing the ~/.bashrc file and adding the proxy value. Use the following command to edit file.
$gedit ~/.bashrc
Then add the following line
http_proxy="http://userid:pass_word@proxy:port/"
https_porxy="https://userid:pass_word@proxy:port/"
ftp_proxy="ftp://userid:pass_word@proxy:port/"
You can also set the domain which should not use proxy by no_proxy environment variable. This will be coma separated string containing domain name. Like
 no_proxy="first.domain,secon.domain"
you can also edit some other file like
/etc/environment
/etc/bash.bashrc
/etc/profile
/etc/.bashrc
To change the proxy that uses by apt when run the following command
 $sudo apt-get update 
$sudo apt-get install 
 we have to change the following file
/etc/apt/apt.conf
In this case you have to specify the proxy in the following way
Acquire::http::proxy "http://userid:pass_word@proxy:port/";
Acquire::https::proxy "https://userid:pass_word@proxy:port/";
Acquire::ftp::proxy "ftp://userid:pass_word@proxy:port";
That's all

Cheers
A.Paul

Comments

Popular posts from this blog

Changing caption width in latex

Subtitle in latex

Placing float (table or figure) at the top of the page in otherwise empty page in LaTeX