Repo 超时了

来源:互联网 发布:js使用正则表达式替换 编辑:程序博客网 时间:2024/04/29 02:48

  下载Android源码是比较简单的事情,我在自己家的电脑上轻松搞定。具体下载步骤此处略去不表,详细步骤请参考Android官网的《Get Android Source Code》一章。

    参考网址:http://source.android.com/source/download.html


    然而奇怪的是,我在公司的电脑上怎么也下载不下来。我的环境是Windows7下使用VirtualBox虚拟出来的x64 Ubuntu 10.10。当我执行到下面一步时,错误发生了:

    $ repo init -u git://android.git.kernel.org/platform/manifest.git -b gingerbread


    repo报告的错误内容大概是:

 

    connected time out ...

    ...

    fatal: Unable to look up android.git.kernel.org (port 9418) (Name or service not known)

    

    很显然,Repo找不不到android.git.kernel.org服务器!!!!!


    然而有三件事情让我觉得这事实在是诡异万分:


        第一、我的Win7系统和Ubuntu系统,使用网页浏览器都能访问网址  http://android.git.kernel.org

 

        

        第二、我所在的项目组有一另外一台机器,装的是x64bit Ubuntu10.10系统,它能成功的下载Android源Source (之前我一直是依靠它来下载Source的)。

 


       第三、我尝试过不使用VirtualBox虚拟Ubuntu系统,而是直接装双系统:Win7 + 32bit Ubuntu 10.04。但仍然出现相同的错误。


  我苦思敏想中.......


    只剩下一种可能了,我机器的9418端口被封掉了。


  因为公司出于各种原因考虑,给我们开的端口非常有限,记得上次为了调查实现gmail邮箱需要用到SSH这玩意儿,特地向网管申请开了SSH的端口的.......


  我信心十足的去找网管。果然,我项目组那台机器端口比我的机器的端口开的要多啊!只好请网管帮忙开一下9418端口。


  然而,回来一试,我便再次绝望了,脑细胞死了一个军团的数量,error依旧向我笑啊......Repo依然是connected time out!

 

  我苦思敏想中.......


  这时我想到了一点:9418的端口没戏了,但是不是还有http的80端口吗?死马当成活马医吧:


  Step 1. 编辑 /home/username/bin/repo文件

  -  REPO_URL='git://android.git.kernel.org/tools/repo.git' 

+ REPO_URL='http://android.git.kernel.org/tools/repo.git'


    Step 2. 运行新的命令

$ repo init -u http://android.git.kernel.org/platform/manifest.git -b gingerbread


  Step 3. 修改文件.repo/manifests/default.xml

将   fetch="git://android.git.kernel.org/"

改成fetch="http://android.git.kernel.org/"


    Step 4. 运行命令

repo sync


  搞定!!!



原创粉丝点击