Apt-get via a proxy

To get apt-get to go out via a proxy, edit the apt.conf:

sudo nano /etc/apt/apt.conf

Add in your proxy (you only need to add an http proxy, but can add in ftp and https if your repositories require this).

Acquire::http::proxy "http://<proxy>:<port>/"; 
Acquire::ftp::proxy "ftp://<proxy>:<port>/"; 
Acquire::https::proxy "https://<proxy>:<port>/";