https://stackoverflow.com/questions/25322280/how-can-i-configure-a-http-proxy-for-apt-get
I managed to solve it in the following way. Go to the following folder:
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/";
With authentication:
Acquire::http::Proxy "http://username:password@yourproxyaddress:proxyport/";
The /
at the very end was important. Without it it did not work.