13

What is the format of the /etc/apt/sources.list file for Ubuntu?

As an example of the kind of information I am looking for, here is an explanation for Debian sources.list. However, the various sections, such as Distribution and Component, reference Debian releases; I am looking for Ubuntu specific information.

Enterprise
  • 12,352

2 Answers2

13

To more specifically answer the question about the format of sources.list, I suggest man 5 sources.list, which you can also view on the web as sources.list(5) [alt link], which is more detailed than Debian's SourcesList wiki article.

My specific inquiry related to how to specify multiple options, which is covered by sources.list(5) § The deb and deb-src types: options, which says they should be space-delimited, e.g.

deb [arch=amd64 signed-by=/usr/share/keyrings/some-repo.gpg] http://some.repo/apt dev main

This becomes more relevant with the recent apt-key deprecation that suggests using signed-by for all third-party repositories. This is coming soon: "apt-key(8) will last be available in Debian 11 [released 2021.08] and Ubuntu 22.04."

(The only Ubuntu-specific part should be the release and component names, which you can learn from the prior answer to this question.)

Adam Katz
  • 784
  • 8
  • 18
4

The format is exactly the same for Ubuntu.

You can get the Ubuntu distribution release names here. In sources.list use only the lowercased adjective part (precise, trusty, wily, etc.). Example:

deb http://archive.ubuntu.com/ubuntu/ trusty main restricted

The components can be main, restricted, universe and multiverse.

More info: What's the difference between multiverse, universe, restricted and main?

Eric Carvalho
  • 54,385
  • Thanks for the clarification on the release name used in the Distribution section. Is it acceptable to include more than one component (main, restricted, universe and multiverse) on the same line, or should you create a new line for each component you want to use? – Enterprise Feb 22 '16 at 00:54
  • 2
    @PJSingh You can include them all on the same line: deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse. It works with a lot of servers that I manage (and desktops that I use), but I couldn't find any documentation that sets a limit on the number of components per line. – Eric Carvalho Feb 22 '16 at 01:02