Ubuntu VPS - apt update Failing Due to US Mirror Connectivity Issues

Problem:

When running sudo apt update or other apt commands on an Ubuntu VPS, the process fails or hangs. Users may see errors indicating that us.archive.ubuntu.com is unreachable or times out, similar to the below error:

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease Unable to connect to us.archive.ubuntu.com:http:
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease Unable to connect to us.archive.ubuntu.com:http:
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/jammy-security/InRelease Unable to connect to us.archive.ubuntu.com:http:

Cause:

This issue is commonly due to intermittent connectivity problems with the Ubuntu US mirror infrastructure (us.archive.ubuntu.com). These problems are outside the control of your VPS or RackNerd's network, and is a temporary issue with the Ubuntu Archive/mirror server.

Solution:

To resolve this, we recommend switching your system's apt sources from the US-specific mirror to the main Ubuntu archive mirror. The main mirror (archive.ubuntu.com) automatically chooses the fastest and most reliable server based on current conditions.

Steps to Fix:

1. SSH into your VPS.

2. Run the following command to replace the US mirror with the main archive mirror:

sudo sed -i 's/us\.archive\.ubuntu\.com/archive.ubuntu.com/g' /etc/apt/sources.list

After updating the mirror, run:

sudo apt update

Your APT commands should now complete successfully.

Note: This change is persistent across reboots but will be reset if you reinstall the operating system. After any OS reinstallation, remember to repeat the above steps to avoid running into the same issue again.

  • vps package update error, ubuntu apt fix, connectivity issue ubuntu, ubuntu package update issue, apt sources.list, ubuntu vps apt error, archive.ubuntu.com, ubuntu apt mirror problem, apt update failed, ubuntu mirror issue, apt-get not working, us.archive.ubuntu.com, ubuntu vps troubleshooting, ubuntu apt timeout
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Can I request to install Windows Operating System?

Windows is only able to run on our Windows VPS plans, which you can view here:...

Difference between Mb/s and MB/s

In this video, we go over the differences between Megabits per second (Mb/s) and Megabytes per...

Does RackNerd VPS support Custom ISO?

Yes, we can mount a custom Linux ISO of your choice to your KVM VPS service with us. There is no...

How do I use my new VPS?

So you just ordered a new VPS and want to know how to get started with using it? In this video...

How to Boot Your VPS to Rescue Mode

What is rescue mode used for? Rescue mode is useful if for example you may have a corrupt kernel,...