Score:0

sources.list errors

cn flag

I was trying to run: sudo apt-get update

The response I received was:

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

My questions:

  1. What is sources.list?
  2. What happened?
  3. How do I repair/fix this? I have been using Ubuntu 20.04 and thought I would try upgrade to 22.04. I do not know that much about the inner workings of Ubuntu. I am past 60 and find it difficult to know the command line workings unless I can find it printed somewhere. I cannot remember seeing this anywhere. Can you help?
guiverc avatar
cn flag
The `/etc/apt/sources.list` file contains a list of repositories (software sources) where software packages can be found. Entries found in `/etc/apt/sources.list.d/` are added to those sources. Those are run when you run `sudo apt update` which updates your system's list of software packages available from those sources. The upgrades of packages only occurs if you `sudo apt upgrade` or `sudo apt full-upgrade`. FYI: The `/etc/apt/sources.list.d/` directory is empty on a clean install; so its only populated by files you add. https://help.ubuntu.com/community/Repositories/Ubuntu
guiverc avatar
cn flag
That line will have been edited, or added by yourself, where something went wrong and the command `sudo` (*which isn't a valid entry in that file*) ended up inside the file. You can see when it was last edited using `stat /etc/apt/sources.list` and its line 1 that contains that invalid info. Either that line needs correction, removal and then the rest of the file explore for error(s). Restoring default maybe easier.
I sit in a Tesla and translated this thread with Ai:

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.