Using apt-get behind a Proxy

There are several methods for Setting up apt-get to use a http-proxy. We do use sudo to run apt-get on our server so we decided to add an explicit environment settings to /etc/sudoers.

Defaults env_keep = "http_proxy https_proxy ftp_proxy"

Add the http_proxy to .zshrc and the

export http_proxy=http://proxy-noauth.local:8080
export https_proxy=http://proxy-noauth.local:8080
export ftp_proxy=http://proxy-noauth.local:8080

environment is prepared for action:

$ sudo env
...
http_proxy=http://proxy-noauth.local:8080
...