[solved] Sudo is not known on line 1 in source list Help Please

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
lunabelle

[solved] Sudo is not known on line 1 in source list Help Please

Post by lunabelle »

I'm trying to install a program and I've been having a lot of trouble with not being able to read sudo since it's not in the source list. I don't know how to fix it and I'm really confused. It says E: Type 'Sudo' is not known on line 1 in source list and that the list of sources could not be read.
I've tried looking at the sources list by running sudo nano /etc/apt/sources.list in terminal and all it says is #deb cdrom:[Linux Mint 18.1 _Serena_ - Release amd64 20161213]/ xenial contrib main non-free

I can't install anything anymore and it's really frustrating and confusing. Any help on how to fix this would really be appreciated!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
gm10

Re: Sudo is not known on line 1 in source list Help Please

Post by gm10 »

You have a bad entry in your repositories list. You can probably just remove it via Software Sources > Additional repositories and go through the list and disable/remove whatever has the word "sudo" in it. In case of doubt also go > Official Repositories > click on "Restore default settings".

If you're unsure, post output of

Code: Select all

inxi -Sr
Last edited by gm10 on Sat Aug 18, 2018 3:27 am, edited 1 time in total.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Sudo is not known on line 1 in source list Help Please

Post by catweazel »

lunabelle wrote: Sat Aug 18, 2018 2:55 am I'm trying to install a program and I've been having a lot of trouble with not being able to read sudo since it's not in the source list. I don't know how to fix it and I'm really confused. It says E: Type 'Sudo' is not known on line 1 in source list and that the list of sources could not be read.
I've tried looking at the sources list by running sudo nano /etc/apt/sources.list in terminal and all it says is #deb cdrom:[Linux Mint 18.1 _Serena_ - Release amd64 20161213]/ xenial contrib main non-free

I can't install anything anymore and it's really frustrating and confusing. Any help on how to fix this would really be appreciated!
Please post the exact command you are using, and the exact error message, in full.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
karlchen
Level 23
Level 23
Posts: 18227
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Sudo is not known on line 1 in source list Help Please

Post by karlchen »

Hello, Lunabelle.

Note:
The word sudo must occur in any software sources list file.
sudo is a terminal command, which permits you to execute other commands with the privileges of user root. (comparable to "Run as administrator" on Windows.)

Finding the offensive sources list file:
  • Please, open a terminal window. Execute the commandline

    Code: Select all

    inxi -Sr
    exactly as it has been typed here. Mark the complete screen output which inxi will display and paste it into your next reply.
  • Next execute this terminal command

    Code: Select all

    sudo apt-get update
    Mark the complete screen output which apt-get will display and paste it into your next reply.
This should tell where precisely the word sudo is found, although it should not be present.

Regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
lunabelle

Re: Sudo is not known on line 1 in source list Help Please

Post by lunabelle »

Thanks for the help!!
From the first command:

Code: Select all

System:    Host: delilah-Latitude-E6430 Kernel: 4.4.0-53-generic x86_64 (64 bit)
           Desktop: Cinnamon 3.2.7  Distro: Linux Mint 18.1 Serena
Repos:     Active apt sources in file: /etc/apt/sources.list.d/additional-repositories.list
           deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
           deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
           deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
           deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
           deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
           deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
           Active apt sources in file: /etc/apt/sources.list.d/google-chrome.list
           deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
           Active apt sources in file: /etc/apt/sources.list.d/maarten-baert-simplescreenrecorder-xenial.list
           deb http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu xenial main
           deb-src http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu xenial main
           Active apt sources in file: /etc/apt/sources.list.d/mono-official-stable.list
           sudo apt update
           sudo apt update
           Active apt sources in file: /etc/apt/sources.list.d/mono-xamarin.list
           deb http://download.mono-project.com/repo/debian wheezy main
           Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
           deb http://packages.linuxmint.com serena main upstream import backport #id:linuxmint_main
           deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ xenial partner
           Active apt sources in file: /etc/apt/sources.list.d/spotify.list
           deb http://repository.spotify.com stable non-free
and then I ran the second command and it just says

Code: Select all

E: Type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/mono-official-stable.list
E: The list of sources could not be read.
I'm not sure what I could be doing wrong or what I'm missing or why sudo still isn't working though
I think I need to go into the sources and fix it? But I'm not sure
Last edited by karlchen on Sat Aug 18, 2018 4:56 am, edited 1 time in total.
Reason: added [code] tags around the screen output of inxi and of apt-get
lunabelle

Re: Sudo is not known on line 1 in source list Help Please

Post by lunabelle »

catweazel wrote: Sat Aug 18, 2018 3:25 am
lunabelle wrote: Sat Aug 18, 2018 2:55 am I'm trying to install a program and I've been having a lot of trouble with not being able to read sudo since it's not in the source list. I don't know how to fix it and I'm really confused. It says E: Type 'Sudo' is not known on line 1 in source list and that the list of sources could not be read.
I've tried looking at the sources list by running sudo nano /etc/apt/sources.list in terminal and all it says is #deb cdrom:[Linux Mint 18.1 _Serena_ - Release amd64 20161213]/ xenial contrib main non-free

I can't install anything anymore and it's really frustrating and confusing. Any help on how to fix this would really be appreciated!
Please post the exact command you are using, and the exact error message, in full.
I was trying to install obs studio and it says to run
sudo apt install ffmpeg

sudo add-apt-repository ppa:obsproject/obs-studio

sudo apt-get update && sudo apt-get install obs-studio

and I ran the first command and it just said

Code: Select all

E: Type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/mono-official-stable.list
E: The list of sources could not be read.
E: Type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/mono-official-stable.list
E: The list of sources could not be read.
Last edited by karlchen on Sat Aug 18, 2018 4:56 am, edited 1 time in total.
Reason: aadded [code] tags
User avatar
Pjotr
Level 24
Level 24
Posts: 20129
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Sudo is not known on line 1 in source list Help Please

Post by Pjotr »

PPA hell.... Start by disabling all non-official repo's, except those for Google Chrome and maybe Spotify.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
lunabelle

Re: Sudo is not known on line 1 in source list Help Please

Post by lunabelle »

Pjotr wrote: Sat Aug 18, 2018 4:21 am PPA hell.... Start by disabling all non-official repo's, except those for Google Chrome and maybe Spotify.
Oh gosh
Sorry but how do I do that?
gm10

Re: Sudo is not known on line 1 in source list Help Please

Post by gm10 »

lunabelle wrote: Sat Aug 18, 2018 4:16 am Active apt sources in file: /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt update
These are your sudo bug. Solution is

Code: Select all

sudo rm /etc/apt/sources.list.d/mono-official-stable.list
lunabelle wrote: Sat Aug 18, 2018 4:16 am Repos: Active apt sources in file: /etc/apt/sources.list.d/additional-repositories.list
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
The duplication here is also not good. Solution is Menu > Software Sources > Additional repositories and from there remove them until only one of them is left (or none if you don't use Wine).

Last but not least:
lunabelle wrote: Sat Aug 18, 2018 4:16 am Active apt sources in file: /etc/apt/sources.list.d/mono-xamarin.list
deb http://download.mono-project.com/repo/debian wheezy main
This isn't a problem as such but it's the wrong release, regardless. Since we already nuked the mono-official-stable above since it was malformed I suggested to fix this as well by removing it like this:

Code: Select all

sudo rm /etc/apt/sources.list.d/mono-xamarin.list
If are using mono then go to their homepage and find how to add the correct repositories for your release.

Once you're done with it all, run

Code: Select all

apt update
lunabelle

Re: Sudo is not known on line 1 in source list Help Please

Post by lunabelle »

gm10 wrote: Sat Aug 18, 2018 4:37 am
lunabelle wrote: Sat Aug 18, 2018 4:16 am Active apt sources in file: /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt update
These are your sudo bug. Solution is

Code: Select all

sudo rm /etc/apt/sources.list.d/mono-official-stable.list
lunabelle wrote: Sat Aug 18, 2018 4:16 am Repos: Active apt sources in file: /etc/apt/sources.list.d/additional-repositories.list
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main
The duplication here is also not good. Solution is Menu > Software Sources > Additional repositories and from there remove them until only one of them is left (or none if you don't use Wine).

Last but not least:
lunabelle wrote: Sat Aug 18, 2018 4:16 am Active apt sources in file: /etc/apt/sources.list.d/mono-xamarin.list
deb http://download.mono-project.com/repo/debian wheezy main
This isn't a problem as such but it's the wrong release, regardless. Since we already nuked the mono-official-stable above since it was malformed I suggested to fix this as well by removing it like this:

Code: Select all

sudo rm /etc/apt/sources.list.d/mono-xamarin.list
If are using mono then go to their homepage and find how to add the correct repositories for your release.

Once you're done with it all, run

Code: Select all

apt update
I think that fixed it!! Thank you so much!!
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Sudo is not known on line 1 in source list Help Please

Post by catweazel »

gm10 wrote: Sat Aug 18, 2018 4:37 am These are your sudo bug. Solution is
Nice work.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Locked

Return to “Software & Applications”