I am using Elementary OS. When I try to sudo apt-get update or just try to install something through the terminal, I get this message and I have no idea what to do:

E: Type '>' is not known on line 1 in source list /etc/apt/sources.list
E: The list of sources could not be read.

Your course of action is printed right in that first error: open up the file /etc/apt/sources.list in your editor of choice and fix whatever is wrong with the first line.

If you can't spot it, please update your question to include the offending line from the file.

  • Yeah i tried deleting > in the first line, and doing sudo apt-get update right after. The message was the same except it said the same thing but in line two. Then i tried deleting > from all the lines, still didn't work. – mymuscleshurt Apr 17 at 14:10

The error indicates a malformed entry in a source file, which causes the update process to abort. To fix it, you have to either fix the entry (if you know what the right entry should look like) or remove it altogether (that's what I'm going to describe, as it's the fastest way to enable you to update your system again).

First, you need to open the file containing the bad entry. The filename is given in the error message, in your example /etc/apt/sources.list.d/some-ppa.list. Open a terminal, and type

sudo nano /etc/apt/sources.list.d/some-ppa.list

and press Enter. After entering your password, you should now see the file opened in the text editor nano.

Now you need to locate the malformed entry. It should be on the line number given in the error message - in your case that would be line 1.

This line should be incomplete and start with the unknown type the update process is complaining about (here >). Just delete the whole line, and save/close the file with Ctrl+X.

That's it. You should now be able to successfully run the update process!

If that entry is all that's in the file, then you can just delete the file. To do this, just open a terminal and run the following command:

sudo rm /etc/apt/sources.list.d/some-ppa.list
  • I don't have some-ppa.list in the sources.list.d directory. – mymuscleshurt Apr 17 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.