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 utilizatori au considerat informația utilă
Răspunsul a fost util?

Articole similare

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...

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 Change SSH Port on Your VPS

Looking to add a small layer of security to your Linux VPS? Interested in learning how to change...

How to disable SELINUX on VPS

CentOS deployments by default come with SELINUX enabled. In certain circumstances, you may want...