- conda的代理设置(注意conda不可以用socks代理,需采用http或https代理)
sudo vim ~/.condarc
加入:
auto_activate_base: false
ssl_verify: true
channels:
- defaults
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
show_channel_urls: true
proxy_servers:
https: http://127.0.0.1:19964(根据自己代理设置)
注意,有时候anaconda可能会出现域名不可解析,或者连不上代理等情况,这时需要sudo gedit ~/.condarc,检查一下,是否-default默认的源到了top位置,如果出现了这样的情况,不防删除-default(因为将其移到最后位置,过一段时间可能就又到了top位置,这时我们就不能优先使用国内的源)。
- pip
修改/添加~/.pip/pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com
- apt
修改文件/etc/apt/apt.conf
Acquire::http::proxy "http://127.0.0.1:1081";(根据自己代理设置)
- git
如果挂了全局代理,这样如果需要克隆coding之类的国内仓库,会奇慢无比
所以我建议使用这条命令,只对github进行代理,对国内的仓库不影响
git config --global http.https://github.com.proxy https://127.0.0.1:1080(根据自己代理设置)
git config --global https.https://github.com.proxy https://127.0.0.1:1080(根据自己代理设置)
参考链接: