I am trying to use Snapd to install an app. I enter in the following command:

sudo snap install hello-world

And the error message is:

error: cannot install “hello-world”: Post
https://api.snapcraft.io/v2/snaps/refresh: dial tcp: lookup
api.snapcraft.io on write udp> write: operation not permitted

I asked someone else for advice, and they recommended:

sudo snap set system proxy.http=

sudo snap set system proxy.https=

sudo systemctl restart snapd

sudo snap install hello-world

However, that didn't work either:

error: cannot install “hello-world”: Post
https://api.snapcraft.io/v2/snaps/refresh: proxyconnect tcp: dial tcp connect: connection refused

Does anyone have any advice? In general, I've had no problem connecting to the internet through the Tor browser... But connecting through the terminal has been extremely frustrating.

  • First of all, the advice that you friend gave is 100% wrong. Tor uses socks5 proxy and not an http or https proxy. Are you using Tails or another OS? You don't say and so it is very difficult to provide help without knowing what you are doing.
    – JSEvans
    Feb 20 '20 at 7:48

This solution worked for me on Tails 4.5 :

sudo snap set system proxy.http=socks5://
sudo snap set system proxy.https=socks5://
sudo iptables -I OUTPUT 3 -d -o lo -p tcp -m tcp --dport 9050 --tcp-flags FIN,SYN,RST,ACK SYN -m owner --uid-owner 0 -j ACCEPT

Source: https://forum.snapcraft.io/t/installing-snap-packages-with-tor/15527/7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.