0

While working on an online tutorial I probably messed up my etc/apt/ folder as every time I use apt or apt-get command I get the following error:

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

Any help please

Kulfy
  • 17,696
  • Please post the output of cat /etc/apt/sources.list.d/kubernetes.list – wjandrea Dec 20 '18 at 18:44
  • @wjandrea OP mentioned that in first comment. I have deleted my comments otherwise you would be able to recognize them on your own. Not sure from where he pasted that to that list.:) – Kulfy Dec 20 '18 at 18:55
  • @Kulfy Oh, I see. Muhammad, please [edit] your post to add details. – wjandrea Dec 20 '18 at 18:57

1 Answers1

0

The content of kubernetes.list is creating problems. Since this file only contains a single line which is obviously not correct so it is better to either delete the file using:

sudo rm /etc/apt/sources.list.d/kubernetes.list

or open file using nano:

sudo nano /etc/apt/sources.list.d/kubernetes.list

and put # before the line to comment it out. Save file using Ctrl+X. and try updating again.

Kulfy
  • 17,696