I've seen many people got stuck at
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install <any-package>
these command despite of setting http_proxy or HTTP_PROXY. Since Ubuntu 15.10, it removed apt-get default proxy configuration. So to overcome this, create an proxy configuration file 95proxies in folder /etc/apt/apt.conf.d/
sudo gedit /etc/apt/apt.conf.d/95proxies
and paste following lines
Acquire::http::proxy "http://proxy.company.com:80/";
Acquire::https::proxy "https://proxy.company.com:80/";
Acquire::ftp::proxy "ftp://proxy.company.com:80/";
Now instead of proxy.company.com:80 write your working proxy:port After this just reboot or logout and use apt-get to install or update package.