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- | 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


Did you run the command as root?

1 Like

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


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- | gpg --dearmor | tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null


sudo su
wget -qO- | gpg --dearmor | tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null

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.


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