The error you're seeing indicates that the system cannot verify the GPG signature for the Brave Browser Nightly repository because the public key (C3DE1DD4F661CDCB) is missing or not trusted. This prevents APT from updating the repository and fetching updates.
To fix this issue, follow these steps:
Step 1: Remove the Brave Nightly Repository
Since you no longer need the Brave Nightly package (you previously removed it), it's best to remove its repository entirely to prevent further errors.
-
Remove the Brave Nightly repository file:
sudo rm /etc/apt/sources.list.d/brave-browser-nightly.list
-
Remove the associated GPG keyring (if it exists):
sudo rm -f /usr/share/keyrings/brave-browser-nightly-archive-keyring.gpg
-
Update APT to reflect the changes:
sudo apt update
This should stop APT from trying to access the Brave Nightly repository and eliminate the error.
Step 2: (Optional) Add the Correct Key if You Still Need Brave Nightly
If you still want to use Brave Nightly, you can fix the GPG key issue by importing the correct public key.
-
Download and add the Brave Nightly GPG key:
curl -fsSL https://brave-browser-apt-nightly.s3.brave.com/brave-core-nightly.asc | sudo gpg --dearmor -o /usr/share/keyrings/brave-browser-nightly-archive-keyring.gpg
-
Verify the repository configuration file:
Ensure the repository file exists and is correctly configured. Create or edit the file:
sudo nano /etc/apt/sources.list.d/brave-browser-nightly.list
Add the following line:
deb [signed-by=/usr/share/keyrings/brave-browser-nightly-archive-keyring.gpg] https://brave-browser-apt-nightly.s3.brave.com/ stable main
-
Update APT:
sudo apt update
This should resolve the GPG key error and allow APT to update the Brave Nightly repository.
Step 3: Clean Up Remaining Issues
If you’ve removed Brave Nightly but still see related errors, ensure there are no residual traces of the repository:
-
Check for any remaining Brave-related files:
ls /etc/apt/sources.list.d/ | grep brave
If any Brave-related .list files remain, delete them:
sudo rm /etc/apt/sources.list.d/brave*.list
-
Clean up unused keys:
List all trusted GPG keys:
apt-key list
Look for Brave-related keys (e.g., C3DE1DD4F661CDCB). Remove them using:
sudo apt-key del C3DE1DD4F661CDCB
-
Update APT again:
sudo apt update
Step 4: Final Verification
After completing the above steps, run the following command to ensure APT is functioning correctly without errors:
sudo apt update
You should no longer see the NO_PUBKEY or GPG errors related to Brave.
Summary
- If you no longer need Brave Nightly, simply remove its repository and key.
- If you still need Brave Nightly, re-add the correct GPG key and ensure the repository is properly configured.
- Clean up any residual Brave-related files to prevent future errors.
By following these steps, your system should be free of the GPG-related warnings.