Type 'sudo' is not known in source list [duplicate]

I'm a first time Linux user. My laptop wasn't connecting to the wifi so I followed the instructions from this link.

On typing sudo apt-get update after that, I got this error:

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

What can I do?


My guess is you incorrectly added a source to the /etc/apt/sources.list on line 2.

Try opening up Terminal (Ctrl+Alt+T) and running sudo nano /etc/apt/sources.list.

A regular source line will look similar to this:
deb http://us.archive.ubuntu.com/ubuntu/ vivid main restricted.

If it doesn't, then remove that line and try running sudo apt-get update again. If it works, we know that you added a source incorrectly and you can try following those instructions again.


What I'm assuming happened for you specifically is you added the line sudo apt-get update && sudo apt-get upgrade to /etc/apt/sources.list.

What you should do if this is the case is remove that line entirely, and then uncomment all the source lines (delete all # characters from the beginning of a line.)

Then, you should save the file and exit out of nano.

Now, when you run sudo apt-get update && sudo apt-get upgrade it should work and you can continue on following those instructions.