If you are behind a proxy and need to connect to the internet, you can use:
export http_proxy="http://username:password@host:port/"
For configuring the proxy inside apt-get
:
cd /etc/apt/apt.conf.d
Create a file named 10proxy:
sudo nano 10proxy
Without authentication add the following line:
Acquire::http::Proxy "http://yourproxyaddress:proxyport/";
Acquire::https::Proxy "http://yourproxyaddress:proxyport/";
With authentication:
Acquire::http::Proxy "http://username:password@yourproxyaddress:proxyport/";
The /
at the very end was important. Without it it does not work.