Timeout while Connecting archive.ubuntu.com and security.ubuntu.com

I have a snapcraft.yaml as below:

name: tgcli
version: git
summary: A Telegram Terminal Application
description: |
  `tgcli` is a terminal application to send
  message with bots on Telegram.

base: core18
confinement: devmode

parts:
  tgcli:
    plugin: rust
    source: .

apps:
  tgcli:
    command: bin/tgcli

I’m trying to build a Rust terminal application. I am here in the documentation. I run snapcraft. It tries to connect archive.ubuntu.com and security.ubuntu.com, yet fails to do so after a couple of minutes. The full output is:

Launching a container.
Build environment is in unknown state, cleaning first.
Waiting for container to be ready
Created symlink /etc/systemd/system/dbus-org.freedesktop.network1.service → /lib/systemd/system/systemd-networkd.service.
Waiting for network to be ready...
Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease                                                                    
  Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out
Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                          
  Could not connect to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                                                   
  Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out
Reading package lists... Done                                 
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Could not connect to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package udev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  systemd

E: Unable to locate package dirmngr
E: Package 'udev' has no installation candidate
E: Unable to locate package fuse
An error occurred when trying to execute 'apt-get install dirmngr udev fuse --yes' with 'LXD': returned exit code 100.

I have tried to solve it, I have seen solutions like in this one, yet it does not work. I think it’s because snaps work in a confined environment.

How can I solve this?

Thanks in advance.

There haven’t been any anwers for days. Seems like I ran into some niche problem.

So, I’ve had this problem since I switched to wireless network. I had been using cabled network before.

Since I switched to wireless network with my wireless adapter, I haven’t been able to use KDEConnect either. This made me suspect of some firewall of some sort.

I changed “Firewall Zone” in “Network > Connections” from empty value to trusted.

KDEConnect has been working since then. However, I still have problem pinging 2001:67c:1360:8001::23.

Changing “Firewall Zone” to home also does not work. It also blocks KDEConnect and that IP is not still reachable.

Does multipass work?

Do you have network in a default 18.04 LXD environment? (e.g.; lxc launch ubuntu:18.04)

Multipass didn’t have it either.

However, a couple of days ago, I bought a new HDD and totally wiped my disk structure to install KDE Neon. So, things have changed.

I have no problem after formatting. It was something about my machine I think.