linux服务器的bash/zsh/git/apt/conda网络代理设置

bash/zsh以及git代理

.bashrc/.zshrc中添加

proxy() {
export http_proxy="http://x.x.x.x:xx"
export https_proxy=$http_proxy
export socks5_proxy="socks5://x.x.x.x:xx"
echo "HTTP Proxy On"
git config --global http.proxy $socks5_proxy
}
noproxy() {
unset http_proxy
unset https_proxy
echo "HTTP Proxy Off"
git config --global --unset http.proxy
}
proxy

apt代理

创建文件

vim /etc/apt/apt.conf.d/proxy.conf

添加

Acquire {
HTTP::proxy "http://x.x.x.x:xx";
HTTPS::proxy "http://x.x.x.x:xx";
}

conda代理

.condarc中添加

proxy_servers:
http: http://x.x.x.x:xx
https: http://x.x.x.x:xx

或用命令

conda config --set proxy_servers.http http://x.x.x.x:xx
conda config --set proxy_servers.https http://x.x.x.x:xx