Permission denied trying to update tor on ubuntu

Firstly I apologise if there is an obvious solution I am relatively new to linux.
I am trying to update my tor version on Ubuntu server 22.04.4 in order to run a relay I have been following this guide Why and how I can enable Tor Package Repository in Debian? | Tor Project | Support however every time I try and run the command " wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null" to add the gpg key (step 3 in the guide) it just says permission denied and gives no further information.

EDIT - I shouldve stated originally the first thing I tried was running with root privelidges this did not change anything although using the alternative guide worked

1 Like

Did you run the command as root?

Using this guide [ Relay Operators | Tor Project | Support ] worked

2 Likes

You are probably running the command as a regular user, you need to either use sudo (if your user has sudo privileges) or run it as root. If you look closely, the command starts with “#”, that means you should execute such command as root (or, again, with sudo).

To solve your issue do either:

sudo wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null

or

sudo su
wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null
2 Likes

Note: The symbol # refers to running the code as root. This means you should have access to a user account with system administration privileges, i.e. your user should be in the sudo group.”

Generally you can jump to root via ‘sudo su’ or add sudo before the sole command you want to run with elevated rights. Suspect that’s the issue.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.