I have a linux-mint VM that is sitting behind a proxy. I have been trying to install vsftpd using the following command:
sudo apt-get install vsftpd
Cannot initiate the connection to archive.ubuntu.com:80
sudo -E apt-get install vsftpd
-E preserves environment variables. Your proxy connection settings are stored in the env of the current user. If you elevate to root via sudo, those connection settings do not appear anymore to apt-get. With the option, the env variable is kept the same for both your user and root, so apt-get can see your proxy settings.
You can compare what is defined using the following commands :
$env $sudo env $sudo -E env