I encountered this bug when I installed Eclipse and want to install plug-ins using Eclipse's update function. It always says "Unable to connect to repository". launchpad points out it is a bug related to java and ipv6.

The workaround is to disable ipv6. Try

$ /sbin/sysctl net.ipv6.bindv6only

If this value is 1 you need to disable the setting:

$ sudo /sbin/sysctl net.ipv6.bindv6only=0

For a persistent fix:
Check /etc/sysctl.conf and /etc/sysctl.d/* for this setting and restart procfs after changing it.