If you are using Ubuntu server behind a proxy you will need to manually add it. There are a few ways of doing this but this is what worked for me..
Usually when adding a proxy via the CLI in ubuntu you would use the http_proxy variables and add it to the /root/.bashrc file..
For some reason I have had a few issues with this but have found that editing /etc/apt/apt.conf with the following line works a treat.. I’m not to sure why but if it works it works.
Now run sudo
apt-get update and you should see that apt is able to contact the necessary servers.