I recently upgraded to Ubuntu 20.04. I tried about 4 different commands to install Tor browser and the first 3 failed. Finally I found step-by-step instructions from HowToGeek.com and they worked perfectly.
The problem seems to be that one of my botched installation attempts messed up my list file. The error message I get when I try to install, reinstall or remove ANYTHING, including ubuntu-software (which does not launch at all), is:
E: Malformed entry 2 in list file /etc/apt/sources.list.d/tor-project.list (Component)
E: The list of sources could not be read.
I read many of these Q&A's and managed to find the actual line that is corrupted. The two lines read:
deb [arch=amd64] https://deb.torproject.org/torproject.org focal main
deb [arch=amd64] https://deb.torproject.org/torproject.org main
How do I know what to change line 2 to? I thought maybe the issue was just an extra space between .org and main that I can see in the code but doesn't show up in the HTML above, but I changed it and still could not apt update.
Is it possible to just delete both lines since Tor itself is working perfectly already?
Get:39 https://deb.torproject.org/torproject.org focal InRelease [2,812 B]
Err:39 https://deb.torproject.org/torproject.org focal InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 74A941BA219EC810 Reading package lists... Done – Angele Feb 08 '21 at 16:38
W: GPG error: https://deb.torproject.org/torproject.org focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 74A941BA219EC810 E: The repository 'https://deb.torproject.org/torproject.org focal InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. – Angele Feb 08 '21 at 16:38
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys PUBKEY
where PUBKEY is the long alphanumeric string from the error message – Organic Marble Feb 08 '21 at 16:46