Let me preface this by saying that I am completely new to linux and working with the terminal (I only started using linux 3 days ago).
That said, I am having an issue while trying to install linux on the terminal. I have seen similar issues described here, but with other error codes. Now, whenever I try to install the browser, I receive the following error in the terminal:
E: Malformed line 1 in source list /etc/apt/sources.list.d/brave-browser-release.list (type)
E: The list of sources could not be read.
E: Malformed line 1 in source list /etc/apt/sources.list.d/brave-browser-release.list (type)
E: The list of sources could not be read.
I am using ubuntu 18.04.3 LTS and am trying to install the latest Brave version.
Iām still learning to work with linux, so detailed explanation would be much appreciated!
Thank you in advance for your time.
@Rb8623,
Thanks for reaching out! I would recommend doing a clean install ā that is, removing any Brave data you currently have on your machine and then using the commands to instal the browser:
Open your terminal and enter the following commands:
rm -rf /etc/apt/sources.list.d/brave-browser*
rm -rf /etc/apt/trusted.gpg.d/brave-browser*
This will delete any Brave filed stored in sources/trusted.
Then, enter
sudo apt-key del D8BAD4DE7EE17AF52A834B2D0BB75829C2D4E821
sudo apt-key del 9228DBCE20DDE5EC46488DE90B31DBA06A8A26F9
This removes any signing keys
Then, remove any remaining packages:
sudo apt purge brave-browser brave-keyring
Then, use the regular installation instructions to try and install Brave. I would recommend doing one line at a time for clarity:
Thank you so much for the reply!
I followed your instructions and got all the way to the last line before receiving an error message āunable to locate package brave-browserā.
Not sure what happened, but here is my command line up to that point.
richard@lenovo:~$ rm -rf /etc/apt/sources.list.d/brave-browser*
richard@lenovo:~$ rm -rf /etc/apt/trusted.gpg.d/brave-browser*
richard@lenovo:~$ sudo apt-key del D8BAD4DE7EE17AF52A834B2D0BB75829C2D4E821
OK
richard@lenovo:~$ sudo apt-key del 9228DBCE20DDE5EC46488DE90B31DBA06A8A26F9
OK
richard@lenovo:~$
richard@lenovo:~$ sudo apt purge brave-browser brave-keyring
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package brave-browser
E: Unable to locate package brave-keyring
richard@lenovo:~$ sudo apt install apt-transport-https curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
curl is already the newest version (7.58.0-2ubuntu3.8).
apt-transport-https is already the newest version (1.6.12).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
richard@lenovo:~$ 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 -
gpg: no valid OpenPGP data found.
richard@lenovo:~$ 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
deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main
richard@lenovo:~$ sudo apt update
Get:1 https://brave-browser-apt-release.s3.brave.com stable InRelease [2,835 B]
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Err:1 https://brave-browser-apt-release.s3.brave.com stable InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4FE13824E3FFC656
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Hit:5 http://ppa.launchpad.net/linrunner/tlp/ubuntu bionic InRelease
Get:6 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:7 https://repo.nordvpn.com/deb/nordvpn/debian stable InRelease [6,174 B]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [629 kB]
Get:9 https://repo.nordvpn.com/deb/nordvpn/debian stable/main amd64 Packages [3,148 B]
Get:10 https://repo.nordvpn.com/deb/nordvpn/debian stable/main i386 Packages [3,130 B]
Get:11 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [417 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [830 kB]
Get:13 http://us.archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [290 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [295 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [73.8 kB]
Get:16 http://us.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 64x64 Icons [143 kB]
Get:17 http://us.archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [26.0 kB]
Get:18 http://us.archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [6,976 B]
Get:19 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [997 kB]
Get:20 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,035 kB]
Get:21 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [320 kB]
Get:22 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [264 kB]
Get:23 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [201 kB]
Get:24 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [457 kB]
Get:25 http://us.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [9,500 B]
Get:26 http://us.archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [4,540 B]
Get:27 http://us.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,464 B]
Get:28 http://us.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [7,972 B]
Get:29 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [606 kB]
Get:30 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [196 kB]
Get:31 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [38.5 kB]
Get:32 http://security.ubuntu.com/ubuntu bionic-security/main DEP-11 48x48 Icons [17.6 kB]
Get:33 http://security.ubuntu.com/ubuntu bionic-security/main DEP-11 64x64 Icons [41.5 kB]
Get:34 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [17.0 kB]
Get:35 http://security.ubuntu.com/ubuntu bionic-security/restricted Translation-en [5,032 B]
Get:36 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages [601 kB]
Get:37 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [628 kB]
Get:38 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [210 kB]
Get:39 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [42.2 kB]
Get:40 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 48x48 Icons [16.4 kB]
Get:41 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [113 kB]
Get:42 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,460 B]
Reading package lists... Done
W: GPG error: https://brave-browser-apt-release.s3.brave.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4FE13824E3FFC656
E: The repository 'https://brave-browser-apt-release.s3.brave.com stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
richard@lenovo:~$ sudo apt install brave-browser
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package brave-browser
richard@lenovo:~$
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.