Dear all,
I encountered a weird thing and I tried a lot of solutions but the situation was still same. Need help!!
First, in order to use the microk8s, I installed it by snap. Because of version issue, I uninstall and reinstall again. However, I didn’t know what happen that it occasionally cannot let me install any library. Here was the error message:
error: unable to contact snap store
I tried to install a very simple package.
$ sudo snap install hello
error: unable to contact snap store
Even I also tried to use this
$ sudo apt install --reinstall snapd
$ sudo snap list
Name Version Rev Tracking Publisher Notes
core 16-2.49.2 10958 latest/stable canonical✓ core
core18 20210309 1997 latest/stable canonical✓ base
gnome-3-34-1804 0+git.3556cb3 66 latest/stable/… canonical✓ -
gtk-common-themes 0.1-50-gf7627e4 1514 latest/stable/… canonical✓ -
snap-store 3.38.0-59-g494f078 518 latest/stable/… canonical✓ -
snapd 2.49.2 11588 latest/stable canonical✓ snapd
$ sudo snap install snapd
snap "snapd" is already installed, see 'snap help refresh'
$ sudo snap install hello
error: unable to contact snap store
So I also tried this
$ sudo apt purge snapd && sudo apt install snapd
$ sudo snap list
No snaps are installed yet. Try 'snap install hello-world'.
$ sudo snap install hello-world
error: cannot install "hello-world": persistent network error: Post
https://api.snapcraft.io/v2/snaps/refresh: dial tcp: lookup api.snapcraft.io: Temporary
But you can see the error was changed…
Here is the status of snapd.service
$ systemctl status snapd.service
● snapd.service - Snap Daemon
Loaded: loaded (/lib/systemd/system/snapd.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-04-21 17:08:38 CST; 46s ago
TriggeredBy: ● snapd.socket
Main PID: 1015335 (snapd)
Tasks: 33 (limit: 38374)
Memory: 20.4M
CGroup: /system.slice/snapd.service
└─1015335 /usr/lib/snapd/snapd
21 17:08:37 10.1.2.110 systemd[1]: Starting Snap Daemon...
21 17:08:37 10.1.2.110 snapd[1015335]: AppArmor status: apparmor is enabled and all features are available
21 17:08:37 10.1.2.110 snapd[1015335]: daemon.go:347: started snapd/2.48.3+20.04 (series 16; classic) ubuntu/20.04 (amd64) linux/5.8.0-49-generic.
21 17:08:38 10.1.2.110 snapd[1015335]: daemon.go:440: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
21 17:08:38 10.1.2.110 systemd[1]: Started Snap Daemon.
21 17:08:38 10.1.2.110 snapd[1015335]: api.go:1007: Installing snap "hello-world" revision unset
21 17:09:19 10.1.2.110 snapd[1015335]: stateengine.go:150: state ensure error: persistent network error: Get https://api.snapcraft.io/api/v1/snaps/sections: dial t>
lines 1-17/17 (END)
Cannot ping the api.snapcraft.io
$ ping api.snapcraft.io
ping: api.snapcraft.io: Temporary failure in name resolution
Snap version :
$ snap --version
snap 2.48.3+20.04
snapd 2.48.3+20.04
series 16
ubuntu 20.04
kernel 5.8.0-49-generic
I really don’t know how to fix it…
Is there any suggestion on this issue?
Thank you so much!
BR,
Chieh