Score:1

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

in flag

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 http://dk.archive.ubuntu.com/ubuntu 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 http://dk.archive.ubuntu.com/ubuntu focal-updates InRelease
  Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable)

Err:3 http://dk.archive.ubuntu.com/ubuntu focal-backports InRelease
  Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable)

Err:4 http://dk.archive.ubuntu.com/ubuntu 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 http://dk.archive.ubuntu.com/ubuntu/dists/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

W: Failed to fetch http://dk.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable)

W: Failed to fetch http://dk.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Cannot initiate the connection to dk.archive.ubuntu.com:80 (2001:878:346::116). - connect (101: Network is unreachable)

W: Failed to fetch http://dk.archive.ubuntu.com/ubuntu/dists/focal-security/InRelease  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?

hr flag
What solutions did you try? Have you tried forcing IPv4 as suggested in [Problem with IPv6 sudo apt-get update/upgrade](https://askubuntu.com/questions/759524/problem-with-ipv6-sudo-apt-get-update-upgrade)
OmniOwl avatar
in flag
@steeldriver I have tried what you said there and it still fails. I have also tried with and without ufw as well as adding nameservers to the config files. None of them worked :/
OmniOwl avatar
in flag
Turns out I cannot ping dk.archive.ubuntu.com from any computer. It just doesn't work. However I can ping some of the others like in. and en. so I switched to en.archive.ubuntu.com
Score:2
in flag

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/dk.archive.ubuntu.com/en.archive.ubuntu.com/g' /etc/apt/sources.list

and finally:

sudo apt update
Whir avatar
vn flag
How did you do that? I have the same issue right now.
mchid avatar
bo flag
@Whir See the updated instructions.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.