Score:0

Type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/onedrive.list

mc flag

I am new to Ubuntu and arrived to this unknown error:

E: Type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/onedrive.list 
guiverc avatar
cn flag
The error message tells you the line number which contains an error, plus the file where the error exists. You need to correct that file; someone with `sudo` rights on your box has created an invalid file in `/etc/apt/sources.list.d/` (a directory which is empty on clean install so `onedrive.list` was added). The command `sudo` elevates your privileges & does not belong in source files.
Rawnak Poudel avatar
mc flag
it's not working with this command
Rawnak Poudel avatar
mc flag
E: Type 'onedrive' is not known on line 1 in source list /etc/apt/sources.list.d/onedrive.list
Score:0
jp flag

Lines in source lists can ether start with deb e.g.:

deb http://archive.ubuntu.com/ubuntu jammy main

or with deb-src e.g.:

deb-src http://archive.ubuntu.com/ubuntu jammy main

deb and deb-srcare known as archive tyoes ... These are expected at the very beginning of each repository source line.

They shouldn't be replaced by any other word or else that other replacement will be parsed as an archive type ... Hence the error message you see:

Type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/onedrive.list

Which means there is the word sudo at the beginning of line number 1 in the source file /etc/apt/sources.list.d/onedrive.list.

To solve this edit that file to comment out that line be prepending # to it, deleting it or correcting its format and save the changes ... Then run sudo apt update afterwords.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.