为apt设置代理:
michael@node:~/Downloads$ ls /etc/apt/apt.conf.d/proxy.conf
/etc/apt/apt.conf.d/proxy.conf
michael@node:~/Downloads$ cat /etc/apt/apt.conf.d/proxy.conf
Acquire {
http::Proxy "http://192.168.0.101:8888/";
https::Proxy "http://192.168.0.101:8888/";
}
为shell和浏览器设置代理:
cat /etc/profile.d/proxy.sh
# set proxy config via profie.d - should apply for all users
export http_proxy="http://192.168.0.101:8888/"
export https_proxy="http://192.168.0.101:8888/"
export ftp_proxy="http://192.168.0.101:8888/"
export no_proxy="127.0.0.1,localhost"
# For curl
export HTTP_PROXY="http://192.168.0.101:8888/"
export HTTPS_PROXY="http://192.168.0.101:8888/"
export FTP_PROXY="http://192.168.0.101:8888/"
export NO_PROXY="127.0.0.1,localhost"
#将要从代理中排除的其他IP添加到NO_PROXY和no_proxy环境变量中
网友评论