From 49681c12b124e236731524b6fbbab7f91147295b Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 24 Dec 2024 13:53:48 +0000 Subject: apt_preferences(5): Specify the order in which files are parsed The order of preference stanzas matters, but this man page did not previously define whether /etc/apt/preferences was parsed before or after the fragment files in preferences.d. Giving a concrete example also provides a hint that numeric prefixes are a useful way to force a particular sort order, and clarifies that the presence or absence of the .pref extension is less important than lexicographic order. Signed-off-by: Simon McVittie --- doc/apt_preferences.5.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index d1047e1e9..6e4e321cd 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -64,7 +64,7 @@ together with other packages from different releases. You have been warned. Note that the files in the /etc/apt/preferences.d -directory are parsed in alphanumeric ascending order and need to obey the +directory need to obey the following naming convention: The files have either no or "pref" as filename extension and only contain alphanumeric, hyphen (-), underscore (_) and period (.) characters. @@ -72,6 +72,19 @@ Otherwise APT will print a notice that it has ignored a file, unless that file matches a pattern in the Dir::Ignore-Files-Silently configuration list - in which case it will be silently ignored. +/etc/apt/preferences +is parsed first, +followed by the files in +/etc/apt/preferences.d +in lexicographic order. +For example, +/etc/apt/preferences.d/00-high-priority.pref, +/etc/apt/preferences.d/50-mid-priority +and +/etc/apt/preferences.d/z-low-priority.pref +would be parsed in that order. + + APT's Default Priority Assignments If there is no preferences file or if there is no entry in the file -- cgit v1.2.3-70-g09d2