Skip to content

Error while updating Ubuntu 22.04.5 OS as Unable to connect to ap-south-1.ec2.archive.ubuntu.com:

0

While attempting to run sudo apt-get upgrade, I encountered the following errors:

W: Failed to fetch http://ap-south-1.ec2.archive.ubuntu.com/ubuntu/dists/jammy/InRelease Could not connect to ap-south-1.ec2.archive.ubuntu.com:80 (13.126.16.60), connection timed out Could not connect to ap-south-1.ec2.archive.ubuntu.com:80 (13.233.101.120), connection timed out Could not connect to ap-south-1.ec2.archive.ubuntu.com:80 (3.110.200.74), connection timed out Could not connect to ap-south-1.ec2.archive.ubuntu.com:80 (3.110.169.167), connection timed out W: Failed to fetch http://ap-south-1.ec2.archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease Unable to connect to ap-south-1.ec2.archive.ubuntu.com:http: W: Failed to fetch http://ap-south-1.ec2.archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease Unable to connect to ap-south-1.ec2.archive.ubuntu.com:http: W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease Could not connect to security.ubuntu.com:80 (185.125.190.81), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.81), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.83), connection timed out Could not connect to security.ubuntu.com:80 (185.125.190.83), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.82), connection timed out Could not connect to security.ubuntu.com:80 (185.125.190.82), connection timed out W: Failed to fetch https://ppa.launchpadcontent.net/ondrej/php/ubuntu/dists/jammy/InRelease Could not connect to ppa.launchpadcontent.net:443 (185.125.190.80), connection timed out W: Failed to fetch https://software.virtualmin.com/vm/7/gpl/apt/dists/virtualmin/InRelease Could not connect to software.virtualmin.com:443 (51.158.66.131), connection timed out W: Some index files failed to download. They have been ignored, or old ones used instead.

I have tried several solutions found online, but none have resolved the issue. Could you please assist in fixing this problem?

Thank you!

asked 2 years ago1.7K views

1 Answer
0

The errors you're encountering suggest that your EC2 instance is having difficulty connecting to the Ubuntu package repositories and other external sources. This is likely due to network connectivity issues. Here are some steps you can try to resolve the problem:

  1. Check your instance's network configuration:

    • Ensure that your security group allows outbound traffic on ports 80 and 443.
    • Verify that your VPC and subnet settings allow internet access.
  2. Test basic network connectivity:

    • Try pinging a public IP address or domain (e.g., 8.8.8.8 or google.com) to check if you have internet access.
  3. Check DNS resolution:

    • Ensure that your instance can resolve domain names by testing with nslookup or dig commands.
  4. Update your sources list:

    • Try changing your package sources to use a different mirror. You can edit the /etc/apt/sources.list file and replace 'ap-south-1.ec2.archive.ubuntu.com' with 'archive.ubuntu.com'.
  5. Temporarily disable IPv6:

    • Sometimes, IPv6 can cause issues. Try disabling it temporarily to see if it resolves the problem.
  6. Check system time:

    • Ensure your system time is correct, as time discrepancies can cause SSL/TLS connection issues.
  7. Clear the APT cache:

    • Run sudo apt clean to clear the local repository of retrieved package files.
  8. Update the package lists:

    • Try running sudo apt update again after making these changes.

If these steps don't resolve the issue, you may need to contact AWS support to check for any region-specific network issues or consider launching a new instance in a different availability zone or region to see if the problem persists.

Remember to revert any temporary changes once you've resolved the issue and can successfully update your system.

Sources
Unable to connect after Ubuntu upgrade | AWS re:Post
How to solve the problem of connection failure after EC2 instance Ubuntu upgrade | AWS re:Post
Failed to connect to Ubuntu EC2 instance | AWS re:Post

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.