为CURL设置proxy

设置代理的方式搜索了一下挺多的,我测试了这两种方式,这两种方式在ubuntu 18.04上可以运行。
有两种方法,第一通过声明环境变量:

export http_proxy="socks5h://127.0.0.1:1080"
export https_proxy="socks5h://127.0.0.1:1080"

第二种方法写在curl的配置文件中

vi ~/.curlrc
proxy = "socks5h://127.0.0.1:1080"

推荐第二种方法,不污染环境。

为wget设置proxy

cat ~/.wgetrc
use_proxy=yes
http_proxy=127.0.0.1:8080
https_proxy=127.0.0.1:8080

为Git设置proxy

推荐使用修改配置文件的方式

[http]
proxy = socks5://127.0.0.1:1080
sslverify = false
[https]
proxy = socks5://127.0.0.1:1080

为go语言设置proxy

这句为go语言运行时候提供代理服务。

 export https_proxy="socks5://127.0.0.1:1080"

为repo设置proxy

在使用repo的时候,发现里面是python写的,调用urllib写的联网方式,url使用的是http方式,但我们想设置的是socks5的方式。我的方式比较直接设置了全局的。

      import socksimport socketsocks.set_default_proxy(socks.SOCKS5, '127.0.0.1', 1080)socket.socket = socks.socksocket

这几个设置完成,可以解决编译chromium os中遇到下载代码的问题:

CIPD selfupdate failed. Trying to bootstrap the CIPD client from scratch...
[P12974 19:38:55.648 client.go:347 W] RPC failed transiently. Will retry in 1s    {"error":"failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 208.43.170.231:443: connect: connection refused", "host":"chrome-infra-packages.appspot.com", "method":"ResolveVersion", "service":"cipd.Repository", "sleepTime":"1s"}
[P12974 19:38:56.688 client.go:347 W] RPC failed transiently. Will retry in 2s    {"error":"failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 208.43.170.231:443: connect: connection refused", "host":"chrome-infra-packages.appspot.com", "method":"ResolveVersion", "service":"cipd.Repository", "sleepTime":"2s"}
[P12974 19:38:58.725 client.go:347 W] RPC failed transiently. Will retry in 4s    {"error":"failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 208.43.170.231:443: connect: connection refused", "host":"chrome-infra-packages.appspot.com", "method":"ResolveVersion", "service":"cipd.Repository", "sleepTime":"4s"}
[P12974 19:39:02.773 client.go:347 W] RPC failed transiently. Will retry in 8s    {"error":"failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 208.43.170.231:443: connect: connection refused", "host":"chrome-infra-packages.appspot.com", "method":"ResolveVersion", "service":"cipd.Repository", "sleepTime":"8s"}
[P12974 19:39:10.832 client.go:347 W] RPC failed transiently. Will retry in 16s   {"error":"failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 208.43.170.231:443: connect: connection refused", "host":"chrome-infra-packages.appspot.com", "method":"ResolveVersion", "service":"cipd.Repository", "sleepTime":"16s"}
[P12974 19:39:26.877 client.go:347 W] RPC failed transiently. Will retry in 32s   {"error":"failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 208.43.170.231:443: connect: connection refused", "host":"chrome-infra-packages.appspot.com", "method":"ResolveVersion", "service":"cipd.Repository", "sleepTime":"32s"}
[P12974 19:40:28.879 client.go:347 W] RPC failed transiently. Will retry in 1m4s  {"error":"failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 34.64.4.84:443: i/o timeout", "host":"chrome-infra-packages.appspot.com", "method":"ResolveVersion", "service":"cipd.Repository", "sleepTime":"1m4s"}
[P12974 19:42:02.879 client.go:347 W] RPC failed transiently. Will retry in 2m8s  {"error":"failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 34.64.4.84:443: i/o timeout", "host":"chrome-infra-packages.appspot.com", "method":"ResolveVersion", "service":"cipd.Repository", "sleepTime":"2m8s"}
[P12974 19:44:40.880 client.go:347 W] RPC failed transiently. Will retry in 4m16s {"error":"failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 34.64.4.84:443: i/o timeout", "host":"chrome-infra-packages.appspot.com", "method":"ResolveVersion", "service":"cipd.Repository", "sleepTime":"4m16s"}
[P12974 19:49:26.881 client.go:347 W] RPC failed transiently. Will retry in 8m32s {"error":"failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 34.64.4.84:443: i/o timeout", "host":"chrome-infra-packages.appspot.com", "method":"ResolveVersion", "service":"cipd.Repository", "sleepTime":"8m32s"}
[P12974 19:58:28.882 client.go:367 W] RPC failed permanently: failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 69.171.247.20:443: i/o timeout {"error":"failed to send request: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 69.171.247.20:443: i/o timeout", "host":"chrome-infra-packages.appspot.com", "method":"ResolveVersion", "service":"cipd.Repository"}
Error: Post https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion: dial tcp 69.171.247.20:443: i/o timeout.
Bootstrap from scratch failed, something is seriously broken. Run the following commands to diagnose if this is repeating:export CIPD_HTTP_USER_AGENT_PREFIX=depot_tools/9db428f4f78ea6eebea783850f889a55d8f6a948/manual/home/king/chrom/depot_tools/.cipd_client selfupdate -version-file /home/king/chrom/depot_tools/cipd_client_version
/home/king/chrom/depot_tools/bootstrap_python3: line 32: bootstrap-3.8.0.chromium.8_bin/python3/bin/python3: No such file or directory
cat: /home/king/chrom/depot_tools/python3_bin_reldir.txt: No such file or directory
/home/king/chrom/depot_tools/vpython3: line 52: /home/king/chrom/depot_tools/.cipd_bin/vpython3: No such file or directory

为curl 、git、go语言、wget、repo设置代理,解决ubuntu 18.04编译chromium os问题相关推荐

  1. ubuntu18.04安装python3_如何在Ubuntu 18.04服务器上安装Python 3和设置编程环境

    一,介绍 Python是一种灵活且通用的编程语言,可在许多用例中利用,在脚本,自动化,数据分析,机器学习和后端开发方面具有优势.开发团队于1991年首次发布,其名称受到英国喜剧团体Monty Pyth ...

  2. ubuntu19 安装git_在Ubuntu 18.04上安装Git

    步骤1.首先,通过运行以下命令确保您的系统和apt包列表完全更新: apt-get update -y apt-get upgrade -y 第2步.在Ubuntu 18.04上安装Git. 现在让我 ...

  3. Ubuntu 18.04 下多显卡超频设置

    Ubuntu 18.04 下多显卡超频设置 环境:ubuntu 18.04 nvidia-A2000 * 6 步骤1: 正常安装ubuntu 18.04 打开(软件和更新)的(附加驱动)并勾选: (n ...

  4. git clone老是失败,试试设置代理

    git clone老是失败,试试设置代理 使用 HTTP 或 HTTPS 协议连接到 Git 仓库的代理方法 # HTTP/HTTPS 协议,port 需与代理软件设置的一致 git config - ...

  5. debian 网络代理_在Ubuntu 18.04/Debian 10上设置系统范围的Proxy(代理)

    本文介绍在Ubuntu 18.04/Debian 10上设置系统范围的Proxy(代理)的方法,代理服务器在其基本级别上是一个计算机系统,其服务位于发出Web请求的计算机(客户端)和包含所请求内容的服 ...

  6. 聊聊 Ubuntu 18.04 静态IP设置

    在Ubuntu 17.10 中 引入了一种新的命令行配置实用工具.它实用YAML格式来配置和描述网络设置. Ubuntu 18.04 默认使用该工具. 关于YAML格式,跟json和xml类似,语法是 ...

  7. x3100服务器设置linux启动,ubuntu 9.04 X3100 显卡开启3D特效

    ubuntu 9.04 X3100 显卡开启3D特效 发布时间:2009-06-10 00:15:15   作者:佚名   我要评论 ubuntu 9.04 X3100 显卡开启3D特效 说明:我的系 ...

  8. 如何在Ubuntu 18.04上设置Mattermost

    介绍 (Introduction) Mattermost is an open source collaboration and messaging platform created with sec ...

  9. ubuntu实现中文输入法_在Ubuntu 18.04中设置中文输入法

    (本文系搬运,图片来自网络,侵删.英语为自己翻译,水平有限,欢迎指点) Setup Chinese Input Method in Ubuntu 18.04 Fri Oct 20 2017 The o ...

最新文章

  1. JSP实现网上招标系统
  2. mysql千万级大数据SQL查询优化
  3. mac系统及xcode使用的SVN客户端安装升级
  4. chrome麦克风权限_如何在Chrome扩展程序中处理麦克风输入权限和语音识别
  5. 青岛外卖小哥帮崩溃程序员写代码,网友看完破防了:佩服又感动。
  6. 转:程序员从初级到中级10个秘诀
  7. 堆中的路径(MOOC)
  8. zemax---窗口整体布局篇
  9. python十二生肖_十二生肖入诗,妙趣横生,越读越有味道!
  10. 音箱常见故障及解决方法
  11. android highcharts柱状图实例,Highcharts 基本柱形图
  12. C# 扫描并读取图片中的文字
  13. echart报错echarts/lib/visual/dataColor in ./node_modules/echarts-liquidfill/src/liquidFill.js
  14. 二十六、 对偶问题(※※※)
  15. RuntimeError: CUDA out of memory. Tried to allocate 1.54 GiB...
  16. css3 nth child 偶数,转载:CSS3 :nth-child(n)方法
  17. acdream 1725 哗啦啦的小彭玉染色问题 离散化并查集
  18. arduino声音传感器与二极管_Arduino--声音传感器(九)
  19. 广州Uber优步司机奖励政策(2月1日~2月7日)
  20. 【JY】代码|极简反应谱分析

热门文章

  1. 有关孔隙比的基本概念和计算公式
  2. 【宋词】之《苏幕遮·碧云天》
  3. [IPhone]如何使用Leak检查内存泄漏
  4. rubymine性能调优
  5. Vuex 4源码学习笔记 - 通过dispatch一步步来掌握Vuex整个数据流(五)
  6. DataTable与结构不同实体类之间的转换
  7. English--谚语
  8. 重要核心词汇(三)(2021.1.1)
  9. Office_00000
  10. C# FTP上传和下载文件操作