1

I have seen a lot of posts but couldn't find a simple answer that summarizes everything.

I am new so I am still confused.

Thanks :)

Nihanth
  • 13
  • If that is not what you need explain what part you do not understand. – Panther May 15 '17 at 16:58
  • 1
    Its not just about apt, I want a solution summarizing proxy setting for everything. – Nihanth May 15 '17 at 17:06
  • Use network manager - http://www.unixmen.com/wp-content/uploads/2015/03/moz1.png and http://www.ubuntugeek.com/how-to-configure-ubuntu-desktop-to-use-your-proxy-server.html . – Panther May 15 '17 at 17:35
  • I don't understand why this is duplicate.
    1. This question is not just for apt.
    2. This question is about seeking a best routine for proxy configs, and as the voted answer suggests, there are many.
    – Nihanth May 15 '17 at 18:09

1 Answers1

0

As there a lot of places to configure proxy settings, it might get confusing at beginning. Let me summarize some things and suggest some good practices.

For console programs

Ex: wget, git and almost every console application which connects to internet.

If you want to configure proxy every time you run your commands for some reason then set the environment variables using following commands.

export http_proxy=http://DOMAIN\USERNAME:PASSWORD@SERVER:PORT/
export ftp_proxy=http://DOMAIN\USERNAME:PASSWORD@SERVER:PORT/

Else if you want to use the same settings everytime for all users, then use of these.

Configure in bashrc

$ nano /etc/bash.bashrc
export http_proxy=http://DOMAIN\USERNAME:PASSWORD@SERVER:PORT/
export ftp_proxy=http://DOMAIN\USERNAME:PASSWORD@SERVER:PORT/

Configure in /etc/environment

$ nano /etc/environment
https_proxy="http://myproxy.server.com:8080/" 
ftp_proxy="http://myproxy.server.com:8080/" ...

Configure using GUI

Open the network settings and set the your system wide network proxy.

Network -> Network proxy -> Configure -> Apply system wide.

But this might not be useful if you have authentication for the proxy.

For apt.

You need to do some extra work for apt, as incidentally apt doesn't obey environment variables,

$ nano /etc/apt/apt.conf
Acquire::http::Proxy "http://USERNAME:PASSWORD@SERVER:PORT";
Acquire::https::Proxy "https://USERNAME:PASSWORD@SERVER:PORT";

For everything out of this scope, there must be an option to configure proxy settings in the application itself. If not I'm sorry ;)

muru
  • 197,895
  • 55
  • 485
  • 740