AptPkg::Policy(3pm)

πŸ’– AptPkg::Policy β€” APT package version policy class πŸ’–

okay besties, gather round 🫢 this one is AptPkg::Policy, a Perl module from the User Contributed Perl Documentation collection, and it is literally the class that handles APT's package version policy. it's giving backstage-pass-to-the-pin-priorities energy and i'm obsessed πŸ’…


✨ SYNOPSIS ✨

like, the entire vibe-check to get in:

use AptPkg::Policy;

that's it. that's the whole thing. iconic. πŸŽ€


🌸 DESCRIPTION 🌸

so AptPkg::Policy is the module that gives you an interface to APT's package version policy. no cap.

πŸ¦‹ AptPkg::Policy

the AptPkg::Policy package implements the APT pkgPolicy class. periodt.

now listen, you don't just make one of these yourself β€” an instance of the AptPkg::Policy class can be fetched using the "policy" method from an AptPkg::Cache object. that's the way that you get in. iykyk πŸ”‘

the following methods are implemented, and yes we're listing all of them, don't skip:

  • priority(VER|FILE) β€” returns the pin priority for the given VER (an AptPkg::Cache::Version object) or FILE (an AptPkg::Cache::PkgFile object). so basically: hand it a version or a package file, get the priority back. simple as. ⭐
  • candidate(PKG) β€” returns the installation candidate version for PKG. and what comes back? an AptPkg::Cache::Version object, fr fr. that's your ✨candidate✨ bestie 🫢

🌈 SEE ALSO 🌈

go give these their flowers too:


πŸ‘‘ AUTHOR πŸ‘‘

this masterpiece was written by Brendan O'Dea <bod@debian.org> πŸ’œ absolute legend behaviour.


and that's a wrap, babes πŸŽ€ this page ships with perl v5.42.3 and it was dated 2026-08-19 β€” so when you're reading this just remember the tech is timeless and so are you. mwah! πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from