0

I launched an EC2 Ubuntu 16.04 server. It is contained in a VPC which is connected to a private VPN. To SSH into the server, you have to connect to that VPN which is also on AWS before having access to the server. After setting everything up and started configuring the server I discovered that sudo apt-get update did not install any update and I got the error below:

ubuntu@private-ip:~$ sudo apt-get update
Err:1 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease Could not connect to eu-west-1.ec2.archive.ubuntu.com:80 (IP), connection timed out [IP]
Err:2 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease Unable to connect to eu-west-1.ec2.archive.ubuntu.com:http: [IP]
Err:3 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease Unable to connect to eu-west-1.ec2.archive.ubuntu.com:http: [IP]
Err:4 http://security.ubuntu.com/ubuntu xenial-security InRelease Cannot initiate the connection to security.ubuntu.com:80 (). - connect (101: Network is unreachable) [IP]
Reading package lists...
Done
W: Failed to fetch http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/dists/xenial/InRelease Could not connect to eu-west-1.ec2.archive.ubuntu.com:80 (IP), connection timed out [IP] W: Failed to fetch http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Unable to connect to eu-west-1.ec2.archive.ubuntu.com:http: [IP]
W: Failed to fetch http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Unable to connect to eu-west-1.ec2.archive.ubuntu.com:http: [IP]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Cannot initiate the connection to security.ubuntu.com:80 (). - connect (101: Network is unreachable) [IP]
W: Some index files failed to download. They have been ignored, or old ones used instead.

I tried to install apache too but got a similar error. Please what could be wrong?

  • Are you sure everything is properly setup, I mean, have you tested the internet connection by any other means? If it works the issue can be as simple as a server temporarily down (use other) or as complex as the VPN somehow blocking some connections. –  Jan 09 '17 at 16:12
  • That is my thought too. That the VPN is blocking some connections but I don't know which. – Salako Ayotunde Jan 09 '17 at 16:15
  • http://askubuntu.com/questions/104695/how-do-i-change-mirrors-in-ubuntu-server-from-regional-to-main <- Ignore the outdated release and just use the same principle to change the mirror. –  Jan 09 '17 at 16:38
  • I am sorry but I do not get what you said. – Salako Ayotunde Jan 10 '17 at 08:12

1 Answers1

1

I was also facing the same issue.

Please Edit outbound rules on security groups of EC-2 instance as following.

Type Protocol Port-Range Destination Description

HTTP TCP 80 Custom ::/0 NA

HTTP TCP 80 Custom 0.0.0.0/0 NA