After my question about a complete list for the Debian 12 sources.list, I was referred from @Stephen Kitt from the old format to the new format DEB822-STYLE FORMAT:
It’s best to use a “DEB822” format file (with a
.sourcesextension rather than.list); for Debian 12, this means/etc/apt/sources.list.d/debian.sources.
I also found the following:
Translated from German
Defining the same repository in both formats is currently not allowed, unless one of the entries is commented out with #. It is still unclear whether deb822 will become mandatory as early as summer with Debian 13 "Trixie". For that, APT 3.0 would first need to be released as a stable version.
Tools like apt-add-repository, apt-source, and software-properties-gtk are designed to work with .sources files (Deb822 format) for specifying APT repository information. While it's true that older releases of Ubuntu and Debian primarily used .list files, the Deb822 format is the standard in newer versions, including Ubuntu 24.04 and later.
Additionally:
- I can store everything in a single file
- The format is
deb822(file extension.sources) - Multiple entries (stanzas) are allowed in one file
- Each entry starts with a new
Types:line
However, I can also save the repository categories (as I had them in the classic sources.list) as separate files like main.sources or non-free.sources, and either comment them out or deactivate them by renaming the file extension, since APT will ignore files that do not end in .sources.
Since apt version 2.9.26, you can run apt modernize-sources as root to automatically rewrite the .list files and converting them to .source files, as long as they are valid already. Otherwise versions 2.3.10 or later supports the new format and can be manually modified.
Is all of that correct so far, and does it actually make sense to split everything like that or is it unnecessary?
Is there anything else important to consider in advance if you switch everything over now?