how to set proxy server in ubuntu/linux

For normal linux cmd

Set this two lines on your .bashrc

export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=https://proxy.company.com:8080

For cmd running under sudo

if you have to run sudo apt-get install, you have to pass the proxy config to root/sudo account

Edit /etc/sudoers and append below line to the file:

Defaults env_keep = "http_proxy https_proxy ftp_proxy DISPLAY XAUTHORITY"

Subscribe to 成蹊笔记

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe