Apt "Connection failed"

The issue definitely related with connectivity, try to ping or trace ubuntu servers. If connectivity is fine, probably you are behind proxy, use environment variable:

export http_proxy=<your_proxy>:<port>