I tried running sudo apt-key list and I didn’t see any entry for Brave.
After running sudo apt-key del C2D4E821 I attempted to run sudo apt remove brave-keyring and received the error E: Unable to locate package brave-keyring.
Further, when I ran curl -s https://brave-browser-apt-release.s3.brave.com/brave-core.asc | sudo apt-key --keyring /etc/apt/trusted.gpg.d/brave-browser-release.gpg add - I received the error gpg: no valid OpenPGP data found.
Not sure where to start after this, but it seems like there are many errors arising from different issues…
Here is a screenshot of my latest terminal output:
If you simply open a browser to the address in the curl command, do you get a download prompt to save the brave-core.asc file?
What is supposed to be happening when you run that command: curl -s https://brave-browser-apt-release.s3.brave.com/brave-core.asc | sudo apt-key --keyring /etc/apt/trusted.gpg.d/brave-browser-release.gpg add -
curl fetches the contents of the URL, which is the repo PGP Public Key hash block
The PGP Public Key is piped (with the | character) into the apt-key command
apt-key then creates a key in the trusted keystore, /etc/apt/trusted.gpg.d/ named brave-browser-release.gpg that contains the PGP key that curl fetched
If you are unable to fetch the PGP from the URL for any reason, your PGP session with the repo will fail, and you cannot install the software.
I do get a download prompt whenever I type the url into a browser address field.
I’m not sure how to resolve the issue with the PGP key.
I think I understand more or less how it’s supposed to work. For whatever reason, it seems like the keys are wrong or maybe it’s trying to authenticate at a different address somehow.
Either way, it’s frustrating.
If you’re getting a different size or a different sha256, can you try downloading using a web browser and saving to a file. Then you can check the file size and run the sha256sum command again.
So after checking the curl command, I noticed nothing happened (still quite new to linux so this may be normal, thought I’d mention anyway). Regardless, I input the next commands as you suggested and here is my output:
~ ls -l brave-core.asc
-rw-r--r-- 1 richard richard 3914 Jan 14 16:41 brave-core.asc
sha256sum brave-core.asc
caf94b3b31d5b49dbbf26b8b05232057a4107b0b8a2a9f990774d4d1a6289a87 brave-core.asc
Ok, so now that you have the Brave key installed (the first entry in the last command you ran), you should be able to pull from our repository without issues.
Start by adding the repository:
echo "deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list
and then check the contents of the file (you can paste it here to confirm that this step worked):
It worked! I have finally installed it successfully! Thank you so much!!
Just out of curiosity, can you explain where it probably went wrong during the installation process or what might have happened that this occurred in the first place?
Just in case I have a similar problem in the future, I am still super new to using Linux.
One last thing I would recommend is to cleanup /etc/apt/trusted.gpg since the Brave key should now also be installed in /etc/apt/trusted.gpg.d/brave-browser-release.gpg.
Double-check that it’s been properly installed by running apt-key list and making sure that you see the same key in /etc/apt/trusted.gpg and /etc/apt/trusted.gpg.d/brave-browser-release.gpg. Then delete the file (rm /etc/apt/trusted.gpg). As a final check that everything is right, run apt update which should work without errors.
As for what went wrong, that’s hard to tell since we basically went through all of the installation steps again one by one (pausing at each step to verify that they all worked) and this time it worked. Based on some of the earlier output you pasted, my guess would be a typo somewhere in the first couple of steps (where we install the key using apt-key).
When I run apt-key list, there is no longer an entry for /etc/apt/trusted.gpg.
Not sure what this means, but just so you can see, here is the current output: