---
title: "Android：android.git.kernel.org 无法访问时下载源代码的解决方法"
author: "Jack22"
date: "2011-10-21T10:58:27Z"
tags: []
categories: ["移动开发"]
slug: "android-android-git-kernel-org"
draft: false
lastmod: "2011-10-21T10:58:27Z"
id: 1205817
url: "https://jack22.iteye.com/blog/1205817"
---

今天正准备编译Android源码，根据官网的指示，首先应该执行

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

来下载repo文件，但报出如下错误：

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

通过浏览器访问http://android.git.kernel.org/时也被报告无法找到服务器。我就是在家里用普通的宽带上网，没有像在公司里面那样有处于防火墙之后的可能。心里面正在暗骂方某人的时候，转念一想，政府应该不会无聊到这个地步，连这个都墙。继续调查之后，发现9月分以来国外也有人遇到同样的[问题](http://stackoverflow.com/questions/7471950/android-repo-sync-fails-with-fatal-unable-to-look-up-android-git-kernel-org-p)。加之8月底kernel.org被黑，也可能导致android.git.kernel.org无法访问。姑且先相信是Android的服务器自己爆掉了，按如下方法，下载到源代码[（来源](http://www.eoeandroid.com/forum.php?mod=viewthread&tid=99130&highlight=&page=2)）：

[view plain](http://blog.csdn.net/crazysjf/article/details/6840671 "view plain")

1. 1. curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" &gt;~/bin/repo
2. 2. chmod a+x ~/bin/repo
3. 3. PATH=~/bin:$PATH
4. 4. cd your\_download\_folder
5. 5. repo  init  -u  git://codeaurora.org/platform/manifest.git -b gingerbread
6. 6. repo sync

另外，据称Android源代码在github也有保存，具体怎么弄下来不知到。如果哪天上面的方法也无效了话，可以研究一下。

转载：[http://blog.csdn.net/crazysjf/article/details/6840671](http://blog.csdn.net/crazysjf/article/details/6840671)