I honestly don't remember if snap installs worked before with 18.04, I just noticed he problem after the upgrade to 20.04.
I have tried all the suggestions I have read here and elsewhere and still get the error...
error: cannot install "hello-world": Post
https://api.snapcraft.io/v2/snaps/refresh: dial tcp: lookup
api.snapcraft.io: no such host
Update: Here are relevant logs after attempting snap install. Does anything jump out?
3/16/23 7:00 PM systemd Starting Snap Daemon...
3/16/23 7:00 PM snapd overlord.go:268: Acquiring state lock file
3/16/23 7:00 PM snapd overlord.go:273: Acquired state lock file
3/16/23 7:00 PM snapd daemon.go:247: started snapd/2.58+20.04 (series 16; classic) ubuntu/20.04 (amd64) linux/5.4.0-144-generic.
3/16/23 7:00 PM systemd tmp-syscheck\x2dmountpoint\x2d215737467.mount: Succeeded.
3/16/23 7:00 PM systemd tmp-syscheck\x2dmountpoint\x2d215737467.mount: Succeeded.
3/16/23 7:00 PM snapd daemon.go:340: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
3/16/23 7:00 PM snapd backends.go:58: AppArmor status: apparmor is enabled and all features are available
3/16/23 7:00 PM systemd Started Snap Daemon.
3/16/23 7:00 PM dbus-daemon [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.180' (uid=0 pid=5965 comm="/usr/lib/snapd/snapd " label="unconfined")
3/16/23 7:00 PM systemd Starting Time & Date Service...
3/16/23 7:00 PM dbus-daemon [system] Successfully activated service 'org.freedesktop.timedate1'
3/16/23 7:00 PM systemd Started Time & Date Service.
3/16/23 7:00 PM snapd api_snaps.go:366: Installing snap "hello-world" revision unset
3/16/23 7:00 PM snapd store_download.go:142: no host system xdelta3 available to use deltas
3/16/23 7:00 PM /usr/lib/gdm3/gdm-x-session qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 61909, resource id: 39846192, major code: 3 (GetWindowAttributes), minor code: 0
3/16/23 7:00 PM sudo pam_unix(sudo:session): session closed for user root
3/16/23 7:00 PM /usr/lib/gdm3/gdm-x-session qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 62084, resource id: 39846194, major code: 3 (GetWindowAttributes), minor code: 0
3/16/23 7:00 PM snapd daemon.go:521: gracefully waiting for running hooks
3/16/23 7:00 PM snapd daemon.go:523: done waiting for running hooks
3/16/23 7:00 PM snapd overlord.go:512: Released state lock file
3/16/23 7:00 PM snapd daemon stop requested to wait for socket activation
3/16/23 7:00 PM systemd snapd.service: Succeeded.
3/16/23 7:00 PM systemd systemd-timedated.service: Succeeded.