Solved network unreachable when installing Android

While preparing for the Madrid edition of the Android Developer Lab, which will happen in a few hours (you know, why doing something in advance, if you can do it at the latest hour), I found an installation problem in my Debian testing (Squeeze of the day) box. I was installing the newest (2.1) Android SDK, via the Android installer (as found in tools r04). When trying to get the list of available packages, I got:

Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: Network is unreachable

After some tinkering, I found the problem (and fix), in How to resolve an issue “Network is unreachable” in Java applications. It seems that it is related to how applications capable of both IPv4 and IPv6 work, and it can be fixed by writing in /etc/sysctl.d/bindv6only.conf the following line:

net.ipv6.bindv6only = 0

…and rebooting, since the kernel needs to read this option when booting.

Apparently the problem happens not only in Android, but also in other Java applications, such as Eclipse.

Tags:
Add a Comment Trackback

5 Comments

  1. [...] Apparently others had the same problem as I had when trying to get the Android SDK to work on my Gnu/Linux box and I found the solution here. [...]

  2. You probably don’t need to reboot. Sysctls are dynamic (I think) so ‘echo 0 > /proc/sys/net/ipv6/bindv6only might work.

  3. Hi,
    Imwamgi : you’re right. Since you’re root, your command is ok.
    Best regards,
    Nicolas

  4. noob here, what am I missing? where is this file located?

  5. You don’t have to reboot the machine, you can execute the following as root

    # sysctl -w net.ipv6.bindv6only=0

    edit the file will make the change permanent, run the command will take effect inmediatly, but until the machin is turned off.

    regards,

Add a Comment

Please leave these two fields as-is:

Protected by Invisible Defender. Showed 403 to 3,167 bad guys.