Skip to content

Instantly share code, notes, and snippets.

@AndrewDDavis
Last active September 10, 2024 20:18
Show Gist options
  • Save AndrewDDavis/73f1e4d1cd25b3c1c657354a8c6a8858 to your computer and use it in GitHub Desktop.
Save AndrewDDavis/73f1e4d1cd25b3c1c657354a8c6a8858 to your computer and use it in GitHub Desktop.
Prevent packages from upgrading to alpha, beta, or release-candidate versions.

Stored at e.g. /etc/apt/preferences.d/alpha_beta_rc_vers.pref.

Explanation:     Prevent packages from upgrading from fully-released versions to alpha,
Explanation:  beta, or release-candidate versions, unless specifically requested on the
Explanation:  command line. Packages can still upgrade to these versions in certain
Explanation:  situations, e.g. if a beta version is installed and an RC version is
Explanation:  available, since they'll both have priority 50.
Explanation:     The syntax for pattern matching is described in 'man apt_preferences',
Explanation:  taking particular note of the following:
Explanation:  - The simple pattern '*' is handled as a special case, rather than a glob
Explanation:    pattern, and may not be used with 'version' in the Pin field.
Explanation:  - Regex patterns must be surrounded by slashes, and are interpreted as
Explanation:    POSIX extended regular expressions (case insensitive).
Package: ?*
Pin: version /[~-](alpha|beta|rc)/
Pin-Priority: 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment