Environment variables are not passed to sudo
: How to keep Environment Variables when Using SUDO
the trick is to add enviroment variables to sudoers config:
sudo visudo
add these lines
Defaults env_keep +="http_proxy" Defaults env_keep +="https_proxy"
form ArchLinux wiki https://wiki.archlinux.org/index.php/Sudo#Environment_variables_.28Outdated.3F.29