AptPkg(3pm)
π NAME π
AptPkg β interface to libapt-pkg π
okay so bestie, this is the module. it's AptPkg, it's (3pm), it's User Contributed Perl Documentation, and it is the Perl doorway into libapt-pkg. no cap.
β¨ SYNOPSIS β¨
use AptPkg;
that's it. that's the whole flex. one line. iconic.
π«Ά DESCRIPTION π«Ά
The AptPkg module provides a low-level XS interface to libapt-pkg. like, it's right up against the metal, talking to apt's C++ guts through XS. main character energy fr.
β οΈ okay listen, this one matters: this interface is intended to be internal, and it may change. so don't get too attached, bestie π₯². if you want the higher level interface, go look at theAptPkg::Config,AptPkg::System,AptPkg::Version,AptPkg::Cache,Apt::PolicyandAptPkg::Sourceclasses instead. that's the move.
π AptPkg π
The AptPkg package provides the following functions:
_init_config(CONF)β Initialise a Configuration object (pkgInitConfig). See theinitmethod inAptPkg::Configfor the receipts. π_init_system(CONF)β Return a pointer to the system object (pkgInitSystem). See thesystemmethod inAptPkg::Config._parse_cmdline(CONF, ARG_DEFS, ...)β Constructs aCommandLineinstance, invokes theParsemethod, and returns the remaining arguments. See theparse_cmdlinemethod inAptPkg::Config. the...is doing so much heavy lifting here and I respect it π
π¦ AptPkg::_config π¦
The AptPkg::_config package wraps a Perl class around the Configuration class. It provides an instance of the global _config object, and exposes the following methods:
Find, FindFile, FindDir, FindB, FindAny, Set, Exists,
ExistsAny, Tree and Dump.
The functions ReadConfigFile and ReadConfigDir are also provided within the package and may be used as methods. yes, methods too β versatile queens π
π§ AptPkg::_config::item π§
The AptPkg::_config::item package wraps a Perl class around the Configuration::Item class. The AptPkg::_config Tree method returns an instance of this class.
Methods:
Value, Tag, FullTag, Parent, Child and Next.
it's giving... tree traversal. literally. π³
β AptPkg::System β
The AptPkg::System package wraps a Perl class around the pkgSystem class. It provides an instance of the global _system object, and exposes the following methods:
Label, VS, Lock and UnLock.
π AptPkg::Version π
The AptPkg::Version package wraps a Perl class around the pkgVersioningSystem class. It exposes the following methods:
Label, CmpVersion, CmpReleaseVer, CheckDep and UpstreamVersion.
πΈ AptPkg::_cache πΈ
The AptPkg::_cache package wraps a Perl class around the pkgCacheFile class. It exposes the following methods:
Open, Close, FindPkg, PkgBegin, FileList, Packages, Policy, MultiArchCache
and NativeArch.
π AptPkg::Cache::_package π
The AptPkg::Cache::_package package wraps a Perl class around the pkgCache::PkgIterator class. It exposes the following methods:
Next, Name, FullName, Arch, Section, VersionList, CurrentVer,
RevDependsList, ProvidesList, Index, SelectedState, InstState,
CurrentState and Flags.
π AptPkg::Cache::_version π
The AptPkg::Cache::_version package wraps a Perl class around the pkgCache::VerIterator class. It exposes the following methods:
VerStr, Section, MultiArch, Arch, ParentPkg, DescriptionList,
TranslatedDescription, DependsList, ProvidesList, FileList, Index
and Priority.
π₯ AptPkg::Cache::_depends π₯
The AptPkg::Cache::_depends package wraps a Perl class around the pkgCache::DepIterator class. It exposes the following methods:
TargetVer, TargetPkg, ParentVer, ParentPkg, Index, CompType and
DepType.
π AptPkg::Cache::_provides π
The AptPkg::Cache::_provides package wraps a Perl class around the pkgCache::PrvIterator class. It exposes the following methods:
Name, ProvideVersion, OwnerVer, OwnerPkg and Index.
π AptPkg::Cache::_description π
The AptPkg::Cache::_description package wraps a Perl class around the pkgCache::DescIterator class. It exposes the following methods:
LanguageCode, md5 and FileList.
(yes md5 is lowercase and no I will not be changing it, that's just her name)
π AptPkg::Cache::_pkg_file π
The AptPkg::Cache::_pkg_file package wraps a Perl class around the pkgCache::PkgFileIterator class. It exposes the following methods:
FileName, Archive, Component, Version, Origin, Label, Site,
IndexType and Index.
π«Ά AptPkg::Cache::_ver_file π«Ά
The AptPkg::Cache::_ver_file package wraps a Perl class around the pkgCache::VerFileIterator class. It exposes the following methods:
File, Index and Offset.
π AptPkg::Cache::_desc_file π
The AptPkg::Cache::_desc_file package wraps a Perl class around the pkgCache::DescFileIterator class. It exposes the following methods:
File
π AptPkg::Cache::_pkg_records π
The AptPkg::Cache::_pkg_records package wraps a Perl class around the pkgRecords class. It exposes the following methods:
Lookup.
just the one. she's lowkey but she's essential π₯Ή
π¦ AptPkg::_policy π¦
The AptPkg::_policy package wraps a Perl class around the pkgPolicy class. It exposes the following methods:
GetPriority and GetCandidateVer.
πΈ AptPkg::_source_list πΈ
The AptPkg::_source_list package wraps a Perl class around the pkgSourceList class. Required as an argument to the AptPkg::_src_records constructor. so like, you can't skip her, she's mandatory π
β¨ AptPkg::_src_records β¨
The AptPkg::_src_records package wraps a Perl class around the pkgSrcRecords class. It exposes the following methods:
Restart, Find.
π Constants π
The following APT enumerations are included, used by attributes of AptPkg::Cache. these are the vocabulary words, bestie, learn them π
pkgCache::Version::VerMultiArch
AptPkg::Version::No, AptPkg::Version::All,
AptPkg::Version::Foreign, AptPkg::Version::Same,
AptPkg::Version::Allowed, AptPkg::Version::AllForeign and
AptPkg::Version::AllAllowed.
pkgCache::Dep::DepType
AptPkg::Dep::Depends, AptPkg::Dep::PreDepends,
AptPkg::Dep::Suggests, AptPkg::Dep::Recommends,
AptPkg::Dep::Conflicts, AptPkg::Dep::Replaces,
AptPkg::Dep::Obsoletes AptPkg::Dep::DpkgBreaks and
AptPkg::Dep::Enhances.
pkgCache::Dep::DepCompareOp
AptPkg::Dep::Or, AptPkg::Dep::NoOp, AptPkg::Dep::LessEq,
AptPkg::Dep::GreaterEq, AptPkg::Dep::Less, AptPkg::Dep::Greater,
AptPkg::Dep::Equals and AptPkg::Dep::NotEquals.
pkgCache::State::VerPriority
AptPkg::State::Important, AptPkg::State::Required,
AptPkg::State::Standard, AptPkg::State::Optional and
AptPkg::State::Extra.
pkgCache::State::PkgSelectedState
AptPkg::State::Unknown, AptPkg::State::Install,
AptPkg::State::Hold, AptPkg::State::DeInstall and
AptPkg::State::Purge.
pkgCache::State::PkgInstState
AptPkg::State::Ok, AptPkg::State::ReInstReq,
AptPkg::State::HoldInst and AptPkg::State::HoldReInstReq.
pkgCache::State::PkgCurrentState
AptPkg::State::NotInstalled, AptPkg::State::UnPacked,
AptPkg::State::HalfConfigured, AptPkg::State::HalfInstalled,
AptPkg::State::ConfigFiles, AptPkg::State::Installed,
AptPkg::State::TriggersAwaited and AptPkg::State::TriggersPending.
pkgCache::Flag::PkgFlags
AptPkg::Flag::Auto, AptPkg::Flag::Essential and
AptPkg::Flag::Important.
π SEE ALSO π
the girlies you should also be reading, fr fr:
π AUTHOR π
Brendan O'Dea <bod@debian.org> β actual legend, wrote all of this, we stan π
and that's a wrap bestie π this whole thing is perl v5.42.3, dated 2026-08-19 β so it's giving vintage but make it timeless. go forth and use AptPkg; responsibly πβ¨
π¦ where this page comes from
- ubuntu stonking: libapt-pkg-perl 0.1.43build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms