I have a messed up sources.list file on Oracular. I think I did this. I was getting errors and no updates for mythtv, so I used the cat command to list the contents of sources.list from a working system (also oracular). I then copied the cat output into a new sources.list file on my problem system. I used gedit to create the new sources.list file. this command I ran in a terminal was sudo -H gedit /etc/apt/sources.list. When I type sudo apt update into a terminal, it now returns "Error: Type 'Types:' is not known on line 1 in source list /etc/apt/sources.list Error: The list of sources could not be read.
1 Answers
APT is highly specific how files are named to determine if they use the typical APT list format of definitions, or DEB822. DEB822 formated source lists are capable of being read, it seems, from /etc/apt/sources.list.d/*.sources files, and you cannot use that in /etc/apt/sources.list which uses the one-line legacy format.
For various reasons, it makes sense to keep a "dummy" sources.list file, but also add in the ubuntu.sources file into /etc/apt/sources.list.d/ to use DEB822 formats.
You should put this content in /etc/apt/sources.list:
# Ubuntu sources have moved to /etc/apt/sources.list.d/ubuntu.sources
... and this in /etc/apt/sources.list.d/ubuntu.sources:
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: oracular oracular-updates
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: oracular-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Note that you can change the URI/URL for the first section to a regional mirror for your region (i.e.
us.archive.ubuntu.comorjp.archive.ubuntu.comfor your region/country mirrors). I useus.archive.ubuntu.combecause I'm located in the USA.
Once you've done this, you can run sudo apt update again and it should just work again for your standard system sources.
If you make these changes and they don't work, you should provide a copy of what you're using, because this should work on any Ubuntu 24.10 system. (these sources use Oracular, because that's the version you're using, but my system is 24.04 - same format though just different Suites defined.)
- 78,878