Safest way to change the permissions of this file so that I can can configure tor package repository and add :
deb [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org < Byzantium> main
deb-src [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org < Bytzantium> main
to tor.list file I created in /etc/apt/sources list.d.
And received not a directory when trying to shift to it i tried to shift to the file in root as well. See pictures
This should add those lines to /etc/apt/sources.list.d/tor.list. However! “byzantium” is not a dist supported by deb.torproject.org, so it will not work. According to this article, byzantium is based on debian bullseye, so changing byzantium to bullseye above, may work, no guarantees.
If you mean >: 1 overrides a file, removing what was in it before, so it is fine to use just one for the first line/echo, but for the second we don’t want to remove the first line we just added, so we have to use 2.
When redirecting output to a file for which you don’t have write permission, try using a command like echo 'content' | sudo tee /path/to/file instead of sudo echo 'content' > /path/to/file and echo 'content' | sudo tee -a /path/to/file instead of echo 'content' >> /path/to/file. If you don’t want any output, you can redirect it to null with something like echo 'content' | sudo tee [-a] /path/to/file > /dev/null.
The command to download and write the GPG key does not work because you are trying to write to a directory/file for which you do not have write permissions. Place a “sudo” in front of the “tee” and it should work.
The cheat sheet commands you liked are meant to be executed as root. You can temporarily become root by using su - or sudo su, and revert to normal by executing exit. You should also take care when running commands from the Internet. Up-to-date information for this topic is found at Why and how I can enable Tor Package Repository in Debian?.