ubuntu各种代理设置

来源:互联网 发布:淘宝网账号注册官网 编辑:程序博客网 时间:2024/05/22 02:17


直接全局代理的话

export http_proxy="http://127.0.0.1:8084"

export https_proxy="http://127.0.0.1:8084"



Ubuntu的apt-get代理设置


apt-get update时Failed to fetch http & Hash Sum mismatch

ubuntu通过设置代理来更新源时可能会遇到上面的问题


一般方法都是将目录下/var/lib/apt/lists/所有的文件清掉

Failed to fetch … Hash Sum mismatch. tried rm apt/list but didn't work


方法是

Create file /etc/apt/apt.conf.d/99fixbadproxy
with this content


Acquire::http::Pipeline-Depth 0;
Acquire::http::No-Cache true;
Acquire::BrokenProxy    true;


再次尝试就可以了



https://askubuntu.com/questions/679233/failed-to-fetch-hash-sum-mismatch-tried-rm-apt-list-but-didnt-work




ubuntu apt-get 使用代理设置,坑爹。。

pip 代理设置,坑爹的代理继续


网上查了一下,pip pip3 有个选项,叫做


--proxy <proxy>            Specify a proxyin theform
                              [user:passwd@]proxy.server:port.
我们直接用这个命令就好了,不过这个命令需要每次在你下载包时附加,比如这样:


pip3 --proxy 127.0.0.1:6152 install numpy
这太麻烦了,编辑 ~ / . bashrc 文件,或者如果你使用了zsh,那么就是 ~ / .zshrc ,在文末添加 alias pip3 = "pip3 --proxy 127.0.0.1:6152" 这样,下次打开终端后就不用每次都输入这么长的代理选项了。


——哦对了,记得把端口改为你自己的端口。


还有就是 pip 只支持 Https Http 代理,Socks 是不行的。



git代理设置


在linux下,我现在使用一台不能访问外网的机器 ,然后通过一台可以使用外网的机器代理上网,应该怎么设置?


Ubuntu系统下浏览器和终端的SS代理配置




0 0
原创粉丝点击