4

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?

  • 2
    What is in line 2 of /etc/apt/sources.list ? – Pilot6 Aug 31 '15 at 16:33
  • It looks like you followed the instruction wrong. Undo the changes in /etc/apt/source.list in the first step. Read the first step again. un-comment the #deb..... lines as instructed. Save the changes and exit the text editor!!!! The second step must be entered in the terminal. By the way, these are instructions from 2009. Are you sure you need to do all these to get your WiFi working in 2015? – user68186 Aug 31 '15 at 16:41
  • Thank you all so much for your prompt responses! You were right, I'd accidentally changed the file. I opened it in the file editor and removed the changes, and it worked perfectly. Thanks again! – Joanna Koshy Sep 2 '15 at 1:06
4

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.

| improve this answer | |
  • My thoughts exactly. Thanks for writing out the answer. I will delete my comment to the question. – user68186 Aug 31 '15 at 16:50

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