教育网使用http proxy下载android源代码

前两天按照书上的流程下载android源代码,下载repo之后,在执行下载时遇到如下错误:

 

$ repo init -u git://android.git.kernel.org/platform/manifest.git 
Getting repo ... 
   from git://android.git.kernel.org/tools/repo.git 
android.git.kernel.org[0: 204.152.191.45]: errno=Operation timed out 
android.git.kernel.org[0: 149.20.20.141]: errno=Operation timed out 
fatal: unable to connect a socket (Operation timed out) 

 

在网上查了查有人说是防火墙问题,可是我关闭了防火墙还是有着样的问题。

还有人说是git使用的端口无法访问,由于我是教育网,使用的学校的代理,于是怀疑是学校代理屏蔽了git端口。

我在网上找了一个教育网代理,使用下面的方法,终于成功的解决了问题:

 

先下载  corkscrew  : http://www.agroman.net/corkscrew/  

tar zxvf  corkscrew-2.0.tar.gz 
cd corkscrew-2.0 
./configure 
make 
cp corkscrew ~/bin  # or to any directory in your $PATH 

 

然后在 ~/bin创建一个shell脚本 'git-proxy' :
#!/bin/sh 
exec ~/bin/corkscrew <proxy name> <proxy port> $* 

~/bin/ 和 <...>根据你的环境来替代 . 

然后执行下面的命令: 

git config --global core.gitproxy '~/bin/git-proxy' 

 

现在在使用repo来下载android源代码,便没问题了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值