现在的位置: 首页 > 综合 > 正文

curl: (6) Couldn’t resolve host ‘android.git.kernel.org’

2013年06月26日 ⁄ 综合 ⁄ 共 794字 ⁄ 字号 评论关闭

$ curl https://android.git.kernel.org/repo > ~/bin/repo

curl: (6) Couldn't resolve host 'android.git.kernel.org'

原因是因为android.git.kernel.org网站被黑了,所以无法从该网站下载repo和android源代码了。

因此我们只能想办法从其他地方下载了.

我们可以从https://www.codeaurora.org/网站下载android源码。

具体方法如下:

下载repo并设置环境变量

$ curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo"> ~/bin/repo
$ chmod a+x ~/bin/repo

$ PATH=~/bin:$PATH

下载android源码

$ mkdir WORKING_DIRECTORY
$cd WORKING_DIRECTORY
$ repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread        
$ repo sync

PS: repo只是一个脚本工具。你可以从任何地方下载repo工具,例如

http://code.google.com/p/git-repo/

但是如何要下载android源代码的话,需要把repo文件打开,把文件开头的

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

的这个地址换成其他可以下载源代码的地址久可以了,上面下载的repo就是把

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

替换成

REPO_URL='git://codeaurora.org/tools/repo.git'

抱歉!评论已关闭.