Can't instal snaps: Ask the admin to allow HTTPS tunnels

Just installed a fresh new ubuntu 18.04.1 server with snapd and can’t install any snaps.
After doing: sudo snap install lxd I get the message:
error: cannot install “lxd”: Post CONNECT denied (ask
the admin to allow HTTPS tunnels)
How can I allow https tunnels? Must be something simple, but it’s driving me crazy, so if anyone knows how to solve this…

addition the snap version: snap --version
snap 2.34.2+18.04
snapd 2.34.2+18.04
series 16
ubuntu 18.04
kernel 4.15.0-38-generic

Are you behind a corporate or ISP proxy of some kind?

If you’re unsure, visit this page and look at the “Proxy” line. For me it says “Proxy: No Proxy or Invisible Proxy Used”. What do you see there?

No proxy in use it’s from my home network:
Proxy: No Proxy or Invisible Proxy Used

and another 18.04 server can do it just fine…must be some package missing or a setting I would say

Hmm intersting…just quick installed a 18.04.1 Ubuntu server in a kvm and it works fine…playing around with different ways of installing, I found out that when I install the server with an apt proxy, snaps won’t install as my problem describes, but when I install the server without the apt proxy all works fine! Even when I add the apt proxy afterwards. Must be a configuration somewhere, but still can’t find it where that’s configured then… Easier/quicker to just reinstall the server then…

(disabling the apt proxy doesn’t help though…snaps still won’t install)

edit: found it! Stupid ubuntu installer: In the past configuring an apt proxy (I use apt-cacher-ng) while installing this proxy was used only by apt I guess…Now with Ubuntu 18.04.1 it also uses it for snap:

grep -rni proxy /etc/ results in: /etc/systemd/system/snapd.service.d/snap_proxy.conf:2:Environment=“HTTP_PROXY=http://apt-proxy.lan:3142” /etc/systemd/system/snapd.service.d/snap_proxy.conf:3:Environment=“HTTP_PROXY=http://apt-proxy.lan:3142”

after removing them, all was ok :slight_smile: