3

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 .sources extension 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?

0

1 Answer 1

4

I’m not aware of anything else that needs to be considered before switching.

How to split files is worth thinking about depending on the use cases. In most cases I think a single file is fine, at least for Debian repositories (or Ubuntu repositories on Ubuntu) — most users should only have one set of those. Multiple files are useful when multiple repositories or distributions are configured; for example, third-party repositories should go in their own file, and on systems tracking testing or unstable, it can be useful to have separate files for testing and unstable.

To disable a specific stanza, you should use an “Enabled: no” entry rather than commenting out the stanza or renaming the file, as recommended in man sources.list.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.