解决下载android源码时出现的无法连接问题

http://developer.android.com/sdk/index.html

http://source.android.com/source/

 

1.curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

执行curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo会出现如下错误:

root@ubuntu:~ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

--2013-04-21 04:30:42-- https://dl-ssl.google.com/dl/googlesource/git-repo/repo

Resolving dl-ssl.google.com... 74.125.128.91, 74.125.128.93, 74.125.128.136, ...

Connecting to dl-ssl.google.com|74.125.128.91|:443... failed: Connection refused.

Connecting to dl-ssl.google.com|74.125.128.93|:443... failed: Connection timed out.

Connecting to dl-ssl.google.com|74.125.128.136|:443... failed: Connection timed out.

Connecting to dl-ssl.google.com|74.125.128.190|:443... failed: Connection timed out.

Connecting to dl-ssl.google.com|2404:6800:4005:c00::5d|:443... failed: Network is unreachable.

 

2.在执行repo sync下载android的时候出现如下信息:

error: Failed to connect to 2404:6800:4008:c00::52: Network is unreachable while accessinghttps://android.googlesource.com/platform/manifest/info/refs?service=git-upload-pack
fatal: HTTP request failed
error: Failed to connect to 2404:6800:4008:c00::52: Network is unreachable while accessinghttps://android.googlesource.com/platform/manifest/info/refs?service=git-upload-pack
fatal: HTTP request failed

curl: (7) Failed to connect to 2404:6800:4008:c00::52: Network is unreachable

curl: (7) Failed to connect to 2404:6800:4008:c00::52: Network is unreachable

curl: (7) Failed to connect to 2404:6800:4008:c00::52: Network is unreachable

curl: (7) Failed to connect to 2404:6800:4008:c00::52: Network is unreachable
error: Failed to connect to 2404:6800:4008:c00::52: Network is unreachable while accessinghttps://android.googlesource.com/platform/bootable/bootloader/legacy/info/refs?service=git-upload-pack
fatal: HTTP request failed
error: Failed to connect to 2404:6800:4008:c00::52: Network is unreachable while accessinghttps://android.googlesource.com/platform/bootable/recovery/info/refs?service=git-upload-pack
fatal: HTTP request failed

解决方法

1. 浏览器登录https://android.googlesource.com/new-password,并用gmail帐号登录(去谷歌注册);

2. 点击网页上的“允许访问”,得到类似

1 machine android.googlesource.com login git-<userName>.gmail.com password <password>  2 machine android-review.googlesource.com login git-<userName>.gmail.com password <password>

3. 把上面那段信息追加到~/.netrc文件结尾(请检查当前用户的权限, 如果不存在此文件则自己新建一个);

4. 下载地址的URI更改为https://android.googlesource.com/a/platform/manifest(中间加上了“/a”)。

5. repo init -u https://android.googlesource.com/a/platform/manifest -b android-2.3.3_r1

6. repo sync

即可拉下Android源码。

官方的说法是:因为访问基本是匿名的,为了防止连接过多(指内网/虚拟机),对同一IP地址的连接数做了一定的限制。看来是用gmail帐号进行认证。

这样的话,在公司网络内或者用虚拟机下载的话,会经常遇到这问题。

源码官网指导网址:http://source.android.com/source/downloading.html

软考初级程序员pdf是指软件考试中的初级程序员考试资料的电子书格式,可以通过电子设备阅读和学习。软件考试是指软件技术人员进行的一种专业水平认证考试,旨在评估程序员的基本编程能力和软件开发技术水平。初级程序员是软件开发领域中的最低级别,一般指对基本编程语言、数据库、系统分析和软件设计等方面有一定掌握的人员。 软考初级程序员pdf的特点是方便学习和备考。由于是电子书的形式,可以随时随地使用电子设备进行阅读和学习,不受时间和地点的限制。同时,pdf格式可以保留原版的排版和格式,使得阅读起来更加方便和舒适。此外,软考初级程序员pdf还可以进行文字搜索和书签标注,方便用户查找和复习重要内容。 软考初级程序员pdf的内容主要涵盖了初级程序员考试的各个知识点和技能要求。包括但不限于编程语言(如Java、C++、Python等)、数据库(如MySQL、Oracle等)、系统分析和设计、软件测试等方面的内容。通过学习软考初级程序员pdf,考生可以系统地了解并掌握这些知识和技能,为考试做好充分准备。 总之,软考初级程序员pdf是软考初级程序员考试的学习资料,具有方便学习和备考的特点。通过学习软考初级程序员pdf,考生可以提高自己的编程能力和软件开发技术水平,为软考初级程序员考试取得好成绩打下基础。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值