0

I'm trying to understand package prioritization in, for example, Ubuntu's APT and /etc/apt/preferences. I'm currently on Ubuntu 20.04 and 22.04, though I think my question is more general.

The man page for apt_preferences discusses the form of preference entries in the section "The Effect of APT Preferences." This section makes several references to information taken from a "Release file", e.g.

The general form assigns a priority to all of the package versions in a given distribution (that is, to all the versions of packages that are listed in a certain Release file)

I'm not able to make enough sense of this section, and certainly not enough to construct my own preference directives, without knowing the rules, construction, and directives contained in this type of file. However, when I search for "Ubuntu what is 'release file'", the only results I find are for an error that occurs when a Release file is missing, which is not my problem.

What is a Release file, and where can I read them?

1 Answers1

1

A Release file contains information about a repository, and signatures of all the package indexes the repository contains. You can see kinetic’s main Release file here; the relevant metadata for pinning is at the top:

Origin: Ubuntu
Label: Ubuntu
Suite: kinetic
Version: 22.10
Codename: kinetic
Date: Thu, 20 Oct 2022 19:47:56 UTC
Architectures: amd64 arm64 armhf i386 ppc64el riscv64 s390x
Components: main restricted universe multiverse
Description: Ubuntu Kinetic 22.10

Several of these fields can be used in Pin directives, for example the codename:

Pin: release n=kinetic

See also In output from `apt update` what do 'InRelease' and 'Release' refer to? and How is the authenticity of Debian packages guaranteed?

Stephen Kitt
  • 434,908
  • This is a helpful answer. Adding that Release files are stored in /var/lib/apt/lists/ in Ubuntu would make it complete. Thanks! – Borea Deitz Jan 05 '23 at 16:00