how to set proxy server in ubuntu/linux

  • Post category:技术

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"
Continue Readinghow to set proxy server in ubuntu/linux