Installing snap packages with Tor

I have successfully installed snap. However, I get the following error when trying to install packages. I am connected through Tor with Linux.

sudo snap install hello-world

error: cannot install “hello-world”: Post dial tcp: lookup on write udp> write: operation not permitted

I think the problem is that it’s being routed through port 53. I tried creating proxies and editing the environment folder to use, but that hasn’t been working.

Any ideas?

did you set the http/https proxies for snapd ?

$ sudo snap set system proxy.http="http://<proxy_addr>:<proxy_port>"
$ sudo snap set system proxy.https="http://<proxy_addr>:<proxy_port>"

Yes, I entered the following 4 lines:

sudo snap set system proxy.http=

sudo snap set system proxy.https=

sudo systemctl restart snapd

sudo snap install hello-world

And the received the output:

error: cannot install “hello-world”: Post proxyconnect tcp: dial tcp connect: connection refused

Do you think this solution could be useful?

it might, i’m not a tor expert but the error you get now looks pretty much like no proxy is running on port 9050 …

Hmm. Can you clarify what you mean? Also, going forward, where do you think is a good forum where I could ask someone else for help?

@jiwjiemmqes @jiwjiemmw If you’re trying to install snap packages in Tails, you have to add an iptables rule to allow the root user to use the SOCKS proxy. Here are the steps which worked for me:

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