How to set HTTP proxy in Ubuntu If your Linux host machine is in a subnet that needs HTTP(s) proxy to access external Internet, please set environment variable http_proxy and https_proxy as below: 1. Set proxy in ~/.bashrc (for current user) or in /etc/profile.d/proxy.sh (for global users), then run "source ~/.bashrc" or "source /etc/profile.d/proxy.sh" to validate the settings. export http_proxy="http://<account>:<password>@<domain>:<port>" export https_proxy="https://<account>:<password>@<domain>:<port>" 2. Set proxy in /etc/apt/apt.conf Acquire::http::Proxy "http://<account>:<password>@<domain>:<port>"; Acquire::https::Proxy "https://<account>:<password>@<domain>:<port>";