Ubuntu 20.04 on server: 'apt-get update' reports that it fails. Cannot reach archive.ubuntu.com

Looking around these forums and elsewhere I find that this is a common issue, however the proposed solutions have not been helpful and thus I ask in hopes that someone might be able to have the right solution.

I have an old IBM M2 server with Ubuntu 20.04 installed. I have tested that I can use curl and ping to different sources like Google and that works just fine. My server can clearly see the internet. But I cannot ping the ubuntu servers, however.

I've tried with ufw enabled and disabled and it's the same either way.

The following errors show up when I attempt sudo apt-get update:

sudo apt-get update
Err:1 focal InRelease Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable) Could not connect to dk.archive.ubuntu.com:80 (130.225.254.116), connection timed out
Err:2 focal-updates InRelease Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable)
Err:3 focal-backports InRelease Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable)
Err:4 focal-security InRelease Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable)
Reading package lists... Done
W: Failed to fetch Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable) Could not connect to dk.archive.ubuntu.com:80 (130.225.254.116), connection timed out
W: Failed to fetch Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable)
W: Failed to fetch Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable)
W: Failed to fetch Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable)
W: Some index files failed to download. They have been ignored, or old ones used instead.

I have not set up any sort of proxy. This server is running out of the box settings and so I am confused as to why apt-get update (and also apt-get install seems to have similar issues) just doesn't work.

Any ideas?

3

1 Answer

Turns out that dk.archive.ubuntu.com was just straight up inaccessible. I tried on computers and server and all. So after pinging a couple of the different archives, I manually edited /etc/apt/sources.list and switched my settings to use the en.archive.ubuntu.com servers instead, which solved my problem.

The following command will automatically change the dk.archive.ubuntu.com archive to the en.archive.ubuntu.com archive:

sudo sed -i 's/ /etc/apt/sources.list

and finally:

sudo apt update
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like