meta_package_manager.managers packageΒΆ
SubmodulesΒΆ
meta_package_manager.managers.apk moduleΒΆ
- class meta_package_manager.managers.apk.APK[source]ΒΆ
Bases:
PackageManagerAlpine Package Keeper (
apk) used by Alpine Linux.Documentation: https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper
Note
installedandoutdatedboth parse thelistapplet, so the version floor is2.10.0: the release that introduced it. Progress output is disabled on every call to keep the parsed lines stable.Caution
outdatedreads the local repository cache rather than the remote, sosyncmust run first for an accurate upgrade list.Initialize
cli_errorslist.- name: str = 'Alpine apk'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://gitlab.alpinelinux.org/alpine/apk-tools'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- requirement: str | None = '>=2.10.0'ΒΆ
The
listapplet, used byinstalled()andoutdated(), was introduced in version2.10.0.
- pre_args: tuple[str, ...] = ('--no-progress',)ΒΆ
Suppress progress indicators so log lines are stable when parsing.
Source:
apk(8)global options.
- version_regexes: tuple[str, ...] = ('apk-tools\\s+(?P<version>[^\\s,]+)',)ΒΆ
$ apk --version apk-tools 2.14.10, compiled for x86_64.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ apk --no-progress list --installed acl-2.2.53-r0 x86_64 {acl} (LGPL-2.1-or-later AND GPL-2.0-or-later) [installed] alpine-baselayout-3.4.3-r1 x86_64 {alpine-baselayout} (GPL-2.0-only) [installed] apk-tools-2.14.0-r5 x86_64 {apk-tools} (GPL-2.0-only) [installed] busybox-1.36.1-r5 x86_64 {busybox} (GPL-2.0-only) [installed] python3-3.11.6-r0 x86_64 {python3} (PSF-2.0) [installed]
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
Caution
Reads from the local repository cache. Run
sync()first to refresh the index.$ apk --no-progress list --upgradable acl-2.3.1-r0 x86_64 {acl} (LGPL-2.1-or-later) [upgradable from: acl-2.2.53-r0] python3-3.11.7-r0 x86_64 {python3} (PSF-2.0) [upgradable from: python3-3.11.6-r0]
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
apk searchmatches package names with case-insensitive substring globbing. Exact matching is not supported and is handled bymeta_package_manager.manager.PackageManager.refiltered_search(). Extended search adds the--descriptionflag so the query is also matched against package descriptions.$ apk --no-progress search --verbose firefox firefox-120.0-r0 firefox-esr-115.5.0-r0 firefox-langpack-de-120.0-r0
$ apk --no-progress search --verbose --description ntp chrony-4.4-r1 ntp-4.2.8_p17-r0 openntpd-6.8_p1-r1
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ sudo apk --no-progress add firefox
- Return type:
- cli_names: tuple[str, ...] = ('apk',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'apk'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all packages.
$ sudo apk --no-progress upgrade
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade one package.
$ sudo apk --no-progress upgrade firefox
meta_package_manager.managers.apm moduleΒΆ
- class meta_package_manager.managers.apm.APM[source]ΒΆ
Bases:
PackageManagerAtomβs package manager, from the sunset Atom editor.
apm installed packages and themes for GitHubβs Atom editor, exposing an npm-style CLI whose queries mpm parses from
--jsonoutput.Atom was sunset on December 15, 2022, so apm is flagged deprecated here. mpm keeps the wrapper while doing so stays cheap: the community fork atom-community/apm has been floated but never produced a usable drop-in, and per the projectβs stability policy a deprecated manager may be dropped without notice once it becomes a burden to maintain.
Initialize
cli_errorslist.- deprecated: bool = TrueΒΆ
A manager marked as deprecated is hidden from package selection by default.
You can still use it by explicitly calling for it on the command line.
A deprecated manager is exempt from the project stability policy: it may be dropped, in part or in full, in any release and without notice, once keeping it working becomes too burdensome. Every deprecation must be documented through
deprecation_url.Deprecated managers are kept out of the functional and integration test matrices, so an unreliable or flaky deprecated manager never blocks a release. The cheap static invariants (ID format, attribute ordering, β¦) still apply for as long as the managerβs code lives in the source tree, to keep that code valid.
- deprecation_url: str | None = 'https://github.blog/2022-06-08-sunsetting-atom/'ΒΆ
GitHub announced the end of the project for December 15, 2022. Source: https://github.blog/2022-06-08-sunsetting-atom/
There is a tentative community fork being discussed. See: https://github.com/atom-community/apm
In the mean time, as long as no apm alternative is useable, it is safe to tag this manager as deprecated.
- name: str = 'Atom apm'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://atom.io/packages'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=1.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- version_regexes: tuple[str, ...] = ('apm\\s+(?P<version>\\S+)',)ΒΆ
$ apm --version apm 2.6.2 npm 6.14.13 node 12.14.1 x64 atom 1.58.0 python 2.7.16 git 2.33.0
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ apm list --json { "core": [ { "name": "background-tips", "version": "0.26.1", "description": "Displays tips about Atom in the background." } ], "user": [ { "name": "file-icons", "version": "2.0.9", "description": "Assign file extension icons" } ] }
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ apm outdated --compatible --json [ { "name": "file-icons", "version": "2.0.9", "latestVersion": "2.0.10", "description": "Assign file extension icons" } ]
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not supports exact matching.
$ apm search --json python | jq [ { "name": "atom-python-run", "main": "./lib/atom-python-run.js", "version": "0.7.3", "description": "Run a python source file.", "keywords": [ "python" ], "repository": "https://github.com/foreshadow/atom-python-run", "license": "MIT", "engines": { "atom": ">=1.0.0 <2.0.0" }, "dependencies": {}, "readme": "Blah blah", "downloads": 41379, "stargazers_count": 16 }, { "name": "build-python", "version": "0.6.3", "description": "Atom Build provider for python/python3", "repository": "https://github.com/idleberg/atom-build-python", "license": "MIT", "keywords": [ "buildprovider", "compile", "python", "python3", "linter", "lint" ], "main": "lib/provider.js", "engines": { "atom": ">=1.0.0 <2.0.0" }, "providedServices": { "builder": { "description": "Compiles Python", "versions": { "2.0.0": "provideBuilder" } } }, "package-deps": [ "build" ], "dependencies": { "atom-package-deps": "^4.3.1" }, "devDependencies": { "babel-eslint": "^7.1.1", "coffeelint-stylish": "^0.1.2", "eslint": "^3.13.1", "eslint-config-atom-build": "^4.0.0", "gulp": "github:gulpjs/gulp#4.0", "gulp-coffeelint": "^0.6.0", "gulp-debug": "^3.0.0", "gulp-jshint": "^2.0.4", "gulp-jsonlint": "^1.2.0", "gulp-lesshint": "^2.1.0", "jshint": "^2.9.4" }, "scripts": { "test": "gulp lint" }, "readme": "Blah blah", "downloads": 2838, "stargazers_count": 0 }, (...) ]
$ apm search --no-description --json python | jq
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ apm install image-view The image-view package is bundled with Atom and should not be explicitly installed. You can run `apm uninstall image-view` to uninstall it and then the version bundled with Atom will be used. Installing image-view to /Users/kde/.atom/packages β
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ apm update --no-confirm
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ apm update --no-confirm image-view
- cli_names: tuple[str, ...] = ('apm',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'apm'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
meta_package_manager.managers.apt moduleΒΆ
- class meta_package_manager.managers.apt.APT[source]ΒΆ
Bases:
PackageManagerBase class for Debianβs
aptfront-end and its variants.Documentation:
See other command equivalences at: https://wiki.archlinux.org/title/Pacman/Rosetta
mpm drives the high-level
aptbinary, notapt-getorapt-cache, over system-wide packages. Mutations escalate throughsudoand force--yesto stay non-interactive.APT_Mintretargets Linux Mintβs same-named but differently-behavedapt.Note
aptβs listing and search commands emit
Listing...,Sorting...andFull Text Search...preambles plus progress indicators.--quietdrops the progress bars, and each parser anchors on thename/suite version archrow shape, so the preamble lines fall through.Note
searchmatches names only by default. An exact query is wrapped as the^query$regex apt supports natively; an extended query switches to--fullto pull descriptions into the output for mpm to post-filter.Initialize
cli_errorslist.- name: str = 'Debian apt'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://wiki.debian.org/AptCLI'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- requirement: str | None = '>=1.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- version_regexes: tuple[str, ...] = ('apt\\s+(?P<version>\\S+)',)ΒΆ
$ apt --version apt 2.0.6 (amd64)
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ apt --quiet list --installed Listing... adduser/xenial,now 3.113+nmu3ubuntu4 all [installed] bc/xenial,now 1.06.95-9build1 amd64 [installed] bsdmainutils/xenial,now 9.0.6ubuntu3 amd64 [installed,automatic] ca-certificates/xenial,now 20160104ubuntu1 all [installed] cron/xenial,now 3.0pl1-128ubuntu2 amd64 [installed] debconf/xenial,now 1.5.58ubuntu1 all [installed] debianutils/xenial,now 4.7 amd64 [installed] diffutils/xenial,now 1:3.3-3 amd64 [installed] e2fsprogs/xenial,now 1.42.13-1ubuntu1 amd64 [installed] ethstatus/xenial,now 0.4.3ubuntu2 amd64 [installed] file/xenial,now 1:5.25-2ubuntu1 amd64 [installed] findutils/xenial,now 4.6.0+git+20160126-2 amd64 [installed] libidn2-0/jammy,now 2.3.2-2build1 amd64 [installed,automatic] libidn2-0/jammy,now 2.3.2-2build1 i386 [installed,automatic]
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ apt --quiet list --upgradable Listing... apt/xenial-updates 1.2.19 amd64 [upgradable from: 1.2.15ubuntu0.2] nano/xenial-updates 2.5.3-2ubuntu2 amd64 [upgradable from: 2.5.3-2]
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
$ apt --quiet search abc --names-only Sorting... Full Text Search... abcde/xenial 2.7.1-1 all A Better CD Encoder abcmidi/xenial 20160103-1 amd64 converter from ABC to MIDI format and back berkeley-abc/xenial 1.01+20150706hgc3698e0+dfsg-2 amd64 ABC - A System for Sequential Synthesis and Verification fuse-overlayfs/jammy,now 1.7.1-1 amd64 [installed] implementation of overlay+shiftfs in FUSE for rootless containers grabcd-rip/xenial 0009-1 all rip and encode audio CDs - ripper libakonadi-kabc4/xenial 4:4.14.10-1ubuntu2 amd64 Akonadi address book access library
$ apt --quiet search ^sed$ --names-only Sorting... Full Text Search... sed/xenial 2.1.9-3 all Blah blah blah
$ apt --quiet search abc --full Sorting... Full Text Search... abcde/xenial 2.7.1-1 all This package contains the essential basic system utilities. . Specifically, this package includes: basename cat chgrp chmod chown chroot cksum comm cp csplit cut dircolors dirname du echo env expand expr factor false fmt hostid id install join link ln logname ls md5sum mkdir mkfifo nohup od paste pathchk pinky pr printenv printf ptx pwd sha1sum seq shred sleep sort split stat stty sum sync tac tail tr true tsort tty uname unexpand uniq unlink users vdir wc who (...) midi/xenial 20160103-1 amd64 converter from ABC to MIDI format and back
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ sudo apt --quiet --yes install git
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ sudo apt --quiet --yes upgrade
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ sudo apt --quiet --yes install --only-upgrade git
- sync()[source]ΒΆ
Sync package metadata.
$ sudo apt --quiet --yes update Hit:1 http://archive.ubuntu.com xenial InRelease Get:2 http://archive.ubuntu.com xenial-updates InRelease [102 kB] Get:3 http://archive.ubuntu.com xenial-security InRelease [102 kB] Get:4 http://archive.ubuntu.com xenial/main Translation-en [568 kB] Fetched 6,868 kB in 2s (2,680 kB/s) Reading package lists... Building dependency tree... Reading state information...
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
$ sudo apt --quiet --yes autoremove $ sudo apt --quiet --yes clean
- Return type:
- cli_names: tuple[str, ...] = ('apt',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- class meta_package_manager.managers.apt.APT_Mint[source]ΒΆ
Bases:
APTLinux Mintβs
apt, a wrapper script that shadows Debianβsapt.Mint ships its own
aptcommand reusing the name but not the behavior ofAPT, so only version probing and search parsing are overridden here; every other operation is inherited.Note
Mintβs
apt --versionprints noapt <version>line, so the version is read fromapt version apt: the version of the apt package itself.Caution
Search rows are
<status> <name> - <description>with no version column and no--fullmode, so extended matching is unsupported and results carry no version.Initialize
cli_errorslist.- name: str = 'Linux Mint apt'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/kdeldycke/meta-package-manager/issues/52'ΒΆ
Home page of the project, only used in documentation for reference.
- cli_names: tuple[str, ...] = ('apt',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'apt-mint'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not supports extended matching.
$ /usr/local/bin/apt --quiet search sed v librust-slog-2.5+erased-serde-dev - p python3-blessed - Practical wrapper i sed - GNU stream editor p sed:i386 - GNU stream editor
$ /usr/local/bin/apt --quiet search ^sed$ i sed - GNU stream editor p sed:i386 - GNU stream editor
meta_package_manager.managers.asdf moduleΒΆ
- class meta_package_manager.managers.asdf.ASDF[source]ΒΆ
Bases:
PackageManagerasdf manages parallel versions of multiple developer tools (Node.js, Ruby, Python, Erlang, β¦) through a plugin ecosystem, exposing all of them behind a single CLI.
mpm targets the
0.16.0Go rewrite and later: it calls the space-separated subcommands (asdf list all,asdf plugin add) that replaced the hyphenated forms (list-all,plugin-add) of the older Bash asdf, which is unsupported.Note
asdf is plugin-driven: every tool the user can install is gated behind a plugin (
asdf plugin add nodejs).mpm installdoes not auto-add plugins; the user is expected to register them first withasdf plugin add.Note
Each
(plugin, installed_version)pair is reported as a distinct package, so a tool installed at multiple versions yields multiple entries sharing the same ID.Caution
mpm outdatedonly reports tools that have a currently-active version (marked with*inasdf list) different from their latest stable release. A tool installed without being activated through a.tool-versionsfile does not surface as outdated.Initialize
cli_errorslist.- homepage_url: str | None = 'https://asdf-vm.com'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=0.16.0'ΒΆ
The Go rewrite shipped in
0.16.0on 2025-01-30 replaced the hyphenated subcommands (asdf list-all,asdf plugin-add, β¦) with their space-separated equivalents this wrapper depends on (asdf list all,asdf plugin add, β¦). Older Bash-based releases are not supported.
- version_cli_options: tuple[str, ...] = ('version',)ΒΆ
CLI options used to produce the version of the package manager.
The raw output produced by the package manager CLI will be parsed with the
version_regexesbelow to extract the version number.
- version_regexes: tuple[str, ...] = ('v?(?P<version>\\d+\\.\\d+\\.\\d+)',)ΒΆ
$ asdf version v0.19.0-83adfe6
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
Emits one
meta_package_manager.package.Packageper(plugin, installed_version)pair, so a tool installed at multiple versions yields multiple entries sharing the same ID.$ asdf list nodejs 18.20.4 *20.10.0 ruby *3.2.0
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
Cross-references the currently-active version per plugin (the entry marked with
*inasdf list) with the latest stable version (asdf latest --all). Only plugins whose active version differs from the latest are yielded.$ asdf latest --all nodejs 20.10.0 missing ruby 3.3.0 missing
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
asdf plugin list allenumerates the entire short-name plugin catalogue. The frameworkβsmeta_package_manager.manager.PackageManager.refiltered_search()narrows the listing down to entries that contain the query.$ asdf plugin list all 1password-cli https://github.com/NeoHsu/asdf-1password-cli.git act https://github.com/grimoh/asdf-act.git nodejs https://github.com/asdf-vm/asdf-nodejs.git
- install(package_id, version=None)[source]ΒΆ
Install one package.
asdf install <plugin>requires the plugin to have been added beforehand withasdf plugin add <plugin>. This wrapper does not auto-add plugins.$ asdf install nodejs 20.10.0
- Return type:
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade one package.
asdf has no native upgrade verb: installing the
latestalias downloads the newest stable release alongside any older versions already on disk. The user is responsible for switching the active version withasdf setif desired.$ asdf install nodejs latest
- cli_names: tuple[str, ...] = ('asdf',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'asdf'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- remove(package_id)[source]ΒΆ
Remove one package.
asdf plugin removedeletes the plugin and every version of the tool installed through it, which matchesmpmβs βremove this packageβ contract more cleanly than iteratingasdf uninstallper installed version.$ asdf plugin remove nodejs
- Return type:
meta_package_manager.managers.composer moduleΒΆ
- class meta_package_manager.managers.composer.Composer[source]ΒΆ
Bases:
PackageManagerDependency manager for PHP, driven in global mode.
Every operation is prefixed with
globalso it targets the user-wide Composer project underCOMPOSER_HOME($XDG_CONFIG_HOME/composeron XDG systems,~/.composeron macOS and other Unixes,%APPDATA%\Composeron Windows) rather than a working tree.installedandoutdatedparse Composerβs--format=jsonoutput, whilesearchreads its plain-text listing;--no-ansiis forced on every call to strip color codes.Initialize
cli_errorslist.- name: str = 'PHP Composer'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://getcomposer.org'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=1.4.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- version_regexes: tuple[str, ...] = ('Composer\\s+version\\s+(?P<version>\\S+)',)ΒΆ
$ composer --version Composer version 2.1.8 2021-09-15 13:55:14
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ composer global show --format=json { "installed": [ { "name": "carbondate/carbon", "version": "1.33.0", "description": "A simple API extension for DateTime." }, { "name": "guzzlehttp/guzzle", "version": "6.3.3", "description": "Guzzle is a PHP HTTP client library" }, { "name": "guzzlehttp/promises", "version": "v1.3.1", "description": "Guzzle promises library" }, { "name": "guzzlehttp/psr7", "version": "1.4.2", "description": "PSR-7 message implementation" } ] }
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ composer global outdated --format=json { "installed": [ { "name": "illuminate/contracts", "version": "v5.7.2", "latest": "v5.7.3", "latest-status": "semver-safe-update", "description": "The Illuminate Contracts package." }, { "name": "illuminate/support", "version": "v5.7.2", "latest": "v5.7.3", "latest-status": "semver-safe-update", "description": "The Illuminate Support package." } ] }
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not supports exact matching.
$ composer global search symfony symfony/symfony The Symfony PHP framework symfony/yaml Symfony Yaml Component symfony/var-dumper Symfony (...) dumping PHP variables symfony/translation Symfony Translation Component symfony/routing Symfony Routing Component symfony/process Symfony Process Component symfony/polyfill-php70 Symfony (...) features to lower PHP versions symfony/polyfill-mbstring Symfony (...) Mbstring extension symfony/polyfill-ctype Symfony polyfill for ctype functions symfony/http-kernel Symfony HttpKernel Component symfony/http-foundation Symfony HttpFoundation Component symfony/finder Symfony Finder Component symfony/event-dispatcher Symfony EventDispatcher Component symfony/debug Symfony Debug Component symfony/css-selector Symfony CssSelector Component
$ composer global search --only-name python hiqdev/hidev-python aanro/pythondocx laravel-admin-ext/python-editor pythonphp/pythonphp blyxxyz/python-server nim-development/python-domotics rakshitbharat/pythoninphp tequilarapido/python-bridge
$ search global --only-name pythonphp/pythonphp pythonphp/pythonphp
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ composer global --no-ansi require illuminate/contracts
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ composer global --no-ansi update
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ composer global --no-ansi update illuminate/contracts
- remove(package_id)[source]ΒΆ
Remove one package.
$ composer global --no-ansi remove illuminate/contracts
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
See: https://getcomposer.org/doc/03-cli.md#clear-cache-clearcache-cc
$ composer global --no-ansi clear-cache
- Return type:
- cli_names: tuple[str, ...] = ('composer',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
meta_package_manager.managers.conda moduleΒΆ
- class meta_package_manager.managers.conda.Conda[source]ΒΆ
Bases:
PackageManagerConda cross-language package and environment manager.
Reads go through condaβs
--jsonmode: installed packages come fromconda list --jsonand search fromconda search "*query*" --json. conda has no dedicated outdated command, so the upgrade the solver would perform is simulated withconda update --all --dry-run --jsonand itsUNLINK(current) andLINK(candidate) sets are diffed by name: a name in both is an in-place upgrade, while aLINK-only entry is a freshly pulled dependency and is not reported.Note
Every operation targets condaβs currently active environment, which is
basewhen none is activated. mpm neither activates nor switches environments: it inspects and mutates whatever environment conda resolves from the inheritedCONDA_PREFIX/CONDA_DEFAULT_ENV, exactly as a barecondacall in the same shell would. Per-environment targeting is not supported yet.Note
The
>=4.6.0floor is the release whereupdate --dry-run --jsonsettled on anactionsmapping whoseLINK/UNLINKvalues are package dicts, the shape the outdated diff parses. Much older conda wrappedactionsin a list and emitted barechannel::name-version-buildstrings instead.Initialize
cli_errorslist.- homepage_url: str | None = 'https://conda.org'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=4.6.0'ΒΆ
4.6.0is a conservative floor. By this releaseconda update --dry-run --jsonreportsactionsas a single mapping whoseLINK/UNLINKvalues are lists of package dicts: the exact shapeoutdated()parses. Much older conda wrappedactionsin a list and emitted barechannel::name-version-buildstrings instead of dicts, which the parser below does not handle. The--jsonoutput oflistandsearchpredates this floor by years.See 4.6.0 release.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ conda list --json [ { "base_url": "https://repo.anaconda.com/pkgs/main", "build_number": 0, "build_string": "py312hca03da5_0", "channel": "pkgs/main", "dist_name": "pip-24.0-py312hca03da5_0", "name": "pip", "platform": "osx-arm64", "version": "24.0" }, { "base_url": "https://repo.anaconda.com/pkgs/main", "build_number": 0, "build_string": "py312_0", "channel": "pkgs/main", "dist_name": "pytz-2024.1-py312_0", "name": "pytz", "platform": "osx-arm64", "version": "2024.1" } ]
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
There is no dedicated
conda outdatedcommand, so the upgrade the solver would perform is simulated with--dry-runand theUNLINK(current) /LINK(candidate) sets are diffed by name. A package appearing in both is an in-place upgrade; one appearing in onlyLINKis a freshly-pulled dependency and one in onlyUNLINKis a removal, so neither is reported.$ conda update --all --dry-run --json { "actions": { "FETCH": [], "LINK": [ { "base_url": "https://repo.anaconda.com/pkgs/main", "build_number": 0, "build_string": "py312_0", "channel": "pkgs/main", "dist_name": "pytz-2024.2-py312_0", "name": "pytz", "platform": "osx-arm64", "version": "2024.2" } ], "UNLINK": [ { "base_url": "https://repo.anaconda.com/pkgs/main", "build_number": 0, "build_string": "py312_0", "channel": "pkgs/main", "dist_name": "pytz-2024.1-py312_0", "name": "pytz", "platform": "osx-arm64", "version": "2024.1" } ], "PREFIX": "/opt/conda" }, "dry_run": true, "prefix": "/opt/conda", "success": true }
When the environment is already current, conda omits the
actionskey entirely:$ conda update --all --dry-run --json { "message": "All requested packages already installed.", "success": true }
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not support extended or exact matching. The query is wrapped in
*wildcards to get the broadest substring match conda offers, andmeta_package_manager.manager.PackageManager.refiltered_search()narrows the results down. conda exposes no package description in its search output, so extended matching has nothing to match against.conda returns every available build of every matching package, grouped by name and sorted by ascending version, so the last record of each group carries the latest version.
$ conda search "*pytz*" --json { "pytz": [ { "arch": null, "build": "py27_0", "build_number": 0, "channel": "https://repo.anaconda.com/pkgs/main/osx-arm64", "name": "pytz", "version": "2013b" }, { "arch": null, "build": "py312_0", "build_number": 0, "channel": "https://repo.anaconda.com/pkgs/main/osx-arm64", "name": "pytz", "version": "2024.1" } ] }
- install(package_id, version=None)[source]ΒΆ
Install one package, optionally pinned to a version.
conda accepts a
MatchSpecso the version is appended with=.$ conda install --yes pytz ## Package Plan ## environment location: /opt/conda added / updated specs: - pytz Preparing transaction: done Verifying transaction: done Executing transaction: done
$ conda install --yes pytz=2024.1
- Return type:
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generate the CLI to upgrade a single package, optionally to a version.
$ conda update --yes pytz
$ conda update --yes pytz=2024.2
- cli_names: tuple[str, ...] = ('conda',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'conda'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- remove(package_id)[source]ΒΆ
Remove one package.
$ conda remove --yes pytz ## Package Plan ## environment location: /opt/conda removed specs: - pytz Preparing transaction: done Verifying transaction: done Executing transaction: done
- Return type:
meta_package_manager.managers.deb_get moduleΒΆ
- class meta_package_manager.managers.deb_get.Deb_Get[source]ΒΆ
Bases:
PackageManagerdeb-getinstalls third-party software on Debian and Ubuntu via.debpackages sourced from GitHub releases, direct URLs, and PPAs.Note
deb-getwrapsaptunder the hood for actual package installation and removal, so all operations that modify the system requiresudo.Caution
deb-get list --installedprints bare package names with no versions, so the installed inventory carries no version.searchis likewise version-less and offers no exact or extended mode, so mpm refilters its results.Note
There is no read-only
outdated: detection runsdeb-get update, which also refreshes the package index, so the probe escalates throughsudolike a sync.Initialize
cli_errorslist.- name: str = 'deb-get'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/wimpysworld/deb-get'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- version_regexes: tuple[str, ...] = ('(?P<version>\\d+\\.\\d+\\.\\d+)',)ΒΆ
Regular expressions used to extract the version number.
This property must be a tuple of strings, each of which is a valid regular expression that must contain a group named
<version>.The first of these regexes producing a match and returning non-empty
<version>group will be used as the version string of the package manager.That version string will then be sanitized and normalized by
meta_package_manager.manager.PackageManager.version().By default match the first part that is space-separated.
Caution
These regexes are compiled with
re.MULTILINEonly. They are not compiled withre.VERBOSE, so literal whitespace in the pattern is significant and matches whitespace in the CLI output.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ deb-get list --installed activitywatch anydesk bitwarden deb-get freeplane google-chrome-stable ipscan protonvpn zoom
Note
deb-get list --installedonly outputs bare package names without version information.
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ sudo deb-get update Checking for updates to deb-get installed packages [+] ipscan (3.9.2) has an update pending. 3.9.3 is available.
Note
Outdated detection piggybacks on
deb-get updatewhich also refreshes the package index.
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not support extended or exact matching, and does not provide version information. Returns the best subset of results and lets
meta_package_manager.manager.PackageManager.refiltered_search()refine them.$ deb-get search zoom zoom
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ sudo deb-get install ipscan
- Return type:
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade one package by reinstalling it.
$ sudo deb-get install ipscan
- cli_names: tuple[str, ...] = ('deb-get',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
meta_package_manager.managers.dnf moduleΒΆ
- class meta_package_manager.managers.dnf.DNF[source]ΒΆ
Bases:
PackageManagerFedoraβs RPM package manager.
mpmreads the inventory throughrepoqueryrather than the human-facing listing:--userinstalledfor packages installed on request (dependencies pulled in automatically are skipped) and--upgradesfor pending updates, both with a--queryformatthat joins the fields on a private___MPM___delimiter so summaries containing spaces stay splittable. Every call is forced--color=neverand--quietfor parseable output.Note
removerunsautoremove, so removing a package also drops the dependencies it leaves orphaned.searchmatches names only, with no exact or extended mode.The
DNF5andYUMsubclasses reuse everything here, differing only in the binary and forced arguments.Documentation:
https://wiki.archlinux.org/title/Pacman/Rosetta (command equivalences)
Initialize
cli_errorslist.- name: str = 'Fedora DNF'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/rpm-software-management/dnf'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- requirement: str | None = '>=4.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- DELIMITER = '___MPM___'ΒΆ
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ dnf repoquery --userinstalled --qf FORMAT acl___MPM___2.2.53-1.el8___MPM___Access control list utilities___MPM___x86_64 audit___MPM___3.0.7-4.el9___MPM___User space auditing tools___MPM___x86_64 audit-libs___MPM___3.0.7-4.el9___MPM___Dynamic auditing library___MPM___x86_64
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ dnf repoquery --upgrades --qf FORMAT acl___MPM___2.2.53-1.el8___MPM___2.6.53-1.el8___MPM___Access control list utilities___MPM___x86_64 audit___MPM___2.2.53-1.el8___MPM___2.5.53-1.el8___MPM___User space auditing tools___MPM___x86_64 audit-libs___MPM___2.2.53-1.el8___MPM___2.6.53-1.el8___MPM___Dynamic auditing library___MPM___x86_64
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not support extended or exact matching. So we return the best subset of results and let
meta_package_manager.manager.PackageManager.refiltered_search()refine them.$ dnf --color=never search usd Last metadata expiration check: 0:06:37 ago on Sun 03 Apr 2022. =================== Name Exactly Matched: usd ===================== usd.aarch64 : 3D VFX pipeline interchange file format =================== Name & Summary Matched: usd =================== python3-usd.aarch64 : Development files for USD usd-devel.aarch64 : Development files for USD ======================= Name Matched: usd ========================= lvm2-dbusd.noarch : LVM2 D-Bus daemon usd-libs.aarch64 : Universal Scene Description library
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ sudo dnf --color=never --quiet --assumeyes install pip
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ sudo dnf --color=never --quiet --assumeyes upgrade
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ sudo dnf --color=never --quiet --assumeyes upgrade pip
- remove(package_id)[source]ΒΆ
Remove one package and one only.
$ sudo dnf --color=never --quiet --assumeyes autoremove package_id
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
$ sudo dnf --color=never --quiet --assumeyes autoremove $ dnf --color=never --quiet clean all
- Return type:
- class meta_package_manager.managers.dnf.DNF5[source]ΒΆ
Bases:
DNFThe
dnf5rewrite of DNF, Fedoraβs reference package manager since Fedora 41.Inherits every operation and parser from
DNF. Its forced arguments drop--color=never(dnf5rejects that option), keeping only--quiet.Initialize
cli_errorslist.- name: str = 'Fedora DNF5'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/rpm-software-management/dnf5'ΒΆ
Home page of the project, only used in documentation for reference.
- pre_args: tuple[str, ...] = ('--quiet',)ΒΆ
Reset global options inherited from the DNF above.
dnf5 does not support βcolor=never parameter.
- class meta_package_manager.managers.dnf.YUM[source]ΒΆ
Bases:
DNFYUM, the package manager DNF superseded.
On current Fedora and RHEL the
yumbinary is a wrapper arounddnf.mpmdrives it exactly asDNF, only the binary name differs.Initialize
cli_errorslist.- id: str = 'yum'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- name: str = 'Fedora YUM'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
meta_package_manager.managers.emerge moduleΒΆ
- class meta_package_manager.managers.emerge.Emerge[source]ΒΆ
Bases:
PackageManagerPortageβs
emerge, Gentooβs source-based package manager.Documentation:
See other command equivalences at: https://wiki.archlinux.org/title/Pacman/Rosetta
The outdated listing and the whole-system upgrade operate against the
@worldset. The progress spinner and ANSI coloring are disabled on every call, leaving output the regexes can parse.Note
Two operations lean on companion Portage tools rather than
emergeitself:installedreads the package list throughqlistandcleanuptrims distfiles througheclean. Neither is resolved throughcli_paththe way the referenceemergebinary is; both are expected on thePATH.Warning
cleanupforces a full@worldupgrade before running--depclean: Portage refuses to remove packages until every dependency is resolved, so depcleaning a partially-upgraded system could drop still-needed packages.Initialize
cli_errorslist.- name: str = 'Gentoo emerge'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://wiki.gentoo.org/wiki/Portage#emerge'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- requirement: str | None = '>=3.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- version_regexes: tuple[str, ...] = ('Portage\\s+(?P<version>\\S+)',)ΒΆ
$ emerge --version Portage 3.0.30 (python 3.9.9-final-0, gcc-11.2.1, 5.15.32-gentoo-r1 x86_64)
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
Warning
This suppose the
qlistbinary is available and present on the system. We do not search for it or try to resolves its canonical path withcli_path, as we do for the referenceemergebinary.$ qlist --installed --verbose --nocolor acct-group/audio-0-r1 acct-group/cron-0 app-admin/hddtemp-0.3_beta15-r29 app-admin/perl-cleaner-2.30 app-admin/system-config-printer-1.5.16-r1 app-arch/p7zip-16.02-r8
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ emerge --update --deep --pretend --columns --color n --nospinner @world [blocks B ] app-text/dos2unix [ebuild N ] app-games/qstat [25c] [ebuild R ] sys-apps/sed [2.4.7-r6] [ebuild U] net-fs/samba [2.2.8_pre1] [2.2.7a] [ebuild U] sys-devel/distcc [2.16] [2.13-r1] USE=ip6* -gtk [ebuild r U] dev-libs/icu [50.1.1:0/50.1.1] [50.1-r2:0/50.1] [ebuild r R ] dev-libs/libxml2 [2.9.0-r1:2] USE=icu
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
$ emerge --search --color n --nospinner blah [ Results for search key : blah ] Searching... * sys-process/htop Latest version available: 1.0.2-r1 Latest version installed: [ Not Installed ] Size of files: 380 KiB Homepage: http://htop.sourceforge.net Description: interactive process viewer License: BSD GPL-2 * x11-drivers/nvidia-drivers Latest version available: 455.45.01-r1 Latest version installed: [ Not Installed ] Size of files: 180.214 KiB Homepage: https://www.nvidia.com/Download/Find.aspx Description: NVIDIA Accelerated Graphics Driver License: GPL-2 NVIDIA-r2 [ Applications found : 2 ]
$ emerge --search --color n --nospinner %^sed$
$ emerge --searchdesc --color n --nospinner sed
$ emerge --searchdesc --color n --nospinner %^sed$
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ sudo emerge --quiet --color n --nospinner dev-vcs/git
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ sudo emerge --quiet --color n --nospinner --update --newuse --deep @world
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ sudo emerge --quiet --color n --nospinner --update dev-vcs/git
- remove(package_id)[source]ΒΆ
Remove one package.
$ sudo emerge --quiet --color n --nospinner --unmerge dev-vcs/git
- Return type:
- sync()[source]ΒΆ
Sync package metadata.
$ sudo emerge --quiet --color n --nospinner --sync
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
An update is forced before calling the clean commands, as pointed to by the emerge documentation:
> As a safety measure, depclean will not remove any packages unless all > required dependencies have been resolved. As a consequence, it is often > necessary to run emerge βupdate βnewuse βdeep @world prior to depclean.
Warning
This suppose the
ecleanbinary is available and present on the system. We do not search for it or try to resolves its canonical path withcli_path, as we do for the referenceemergebinary.$ sudo emerge --quiet --color n --nospinner --update --newuse --deep @world $ sudo emerge --quiet --color n --nospinner --depclean $ sudo eclean distfiles
- Return type:
- cli_names: tuple[str, ...] = ('emerge',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
meta_package_manager.managers.eopkg moduleΒΆ
- class meta_package_manager.managers.eopkg.EOPKG[source]ΒΆ
Bases:
PackageManagerSolusβ eopkg package manager, a PiSi fork.
installedandoutdatedparse eopkgβs fixed-width,|-delimited status table; the column regex requires that pipe structure, so the header and===separator rows fall through.--no-coloris forced to keep the output free of ANSI escapes.Mutating operations pass
--yes-allto auto-confirm eopkgβs prompts so they run unattended.Initialize
cli_errorslist.- name: str = 'Solus eopkg'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/getsolus/eopkg/'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- requirement: str | None = '>=3.2.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ eopkg --no-color list-installed --install-info Package Name |St| Version| Rel.| Distro| Date ===================================================================== aalib | i| 1.4.0_5| 8| Solus|14 Oct 2024 abseil-cpp | i| 20240116.2| 10| Solus|14 Oct 2024 accountsservice | i| 23.13.9| 36| Solus|14 Oct 2024 acl | i| 2.3.2| 21| Solus|14 Oct 2024 adwaita-icon-theme | i| 46.2| 28| Solus|14 Oct 2024 adwaita-icon-theme-legacy | i| 46.2| 2| Solus|14 Oct 2024 alsa-firmware | i| 1.2.4| 7| Solus|14 Oct 2024 alsa-lib | i| 1.2.12| 38| Solus|14 Oct 2024 alsa-plugins | i| 1.2.12| 26| Solus|14 Oct 2024 alsa-utils | i| 1.2.12| 28| Solus|14 Oct 2024 aom | i| 3.10.0| 24| Solus|14 Oct 2024 appstream | i| 1.0.1| 9| Solus|14 Oct 2024 appstream-data | i| 49| 51| Solus|14 Oct 2024 appstream-glib | i| 0.8.2| 13| Solus|14 Oct 2024 argon2 | i| 20190702| 6| Solus|14 Oct 2024 at-spi2 | i| 2.52.0| 44| Solus|14 Oct 2024 atkmm | i| 2.28.4| 19| Solus|14 Oct 2024 attr | i| 2.5.2| 25| Solus|14 Oct 2024 audit | i| 4.0.2| 19| Solus|14 Oct 2024 avahi | i| 0.8| 27| Solus|14 Oct 2024 baobab | i| 46.0| 27| Solus|14 Oct 2024
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ eopkg --no-color list-upgrades --install-info Package Name |St| Version| Rel.| Distro| Date ===================================================================== adwaita-icon-theme | i| 46.2| 28| Solus|14 Oct 2024 appstream-data | i| 49| 51| Solus|14 Oct 2024 at-spi2 | i| 2.52.0| 44| Solus|14 Oct 2024 baobab | i| 46.0| 27| Solus|14 Oct 2024
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not supports exact matching.
Naked search without parameters is the same as extended search with all filtering parameters (i.e.
--name --summary --description):$ eopkg --no-color search firefox gjs-dbginfo - Debug symbols for gjs bleachbit - BleachBit frees disk space and maintains privacy firefox - Firefox web browser eid-mw-firefox - Belgian eID add-on for Mozilla Firefox gjs - GNOME JavaScript font-fira-ttf - Mozilla's new typeface, used in Firefox OS geckodriver - WebDriver for Firefox firefox-dbginfo - Debug symbols for firefox nvidia-vaapi-driver-dbginfo - Debug symbols for nvidia-vaapi-driver font-clear-sans-ttf - Clear Sans Fonts - TrueType gjs-devel - Development files for gjs geckodriver-dbginfo - Debug symbols for geckodriver $ eopkg --no-color search firefox --name --summary --description gjs-dbginfo - Debug symbols for gjs bleachbit - BleachBit frees disk space and maintains privacy firefox - Firefox web browser eid-mw-firefox - Belgian eID add-on for Mozilla Firefox gjs - GNOME JavaScript font-fira-ttf - Mozilla's new typeface, used in Firefox OS geckodriver - WebDriver for Firefox firefox-dbginfo - Debug symbols for firefox nvidia-vaapi-driver-dbginfo - Debug symbols for nvidia-vaapi-driver font-clear-sans-ttf - Clear Sans Fonts - TrueType gjs-devel - Development files for gjs geckodriver-dbginfo - Debug symbols for geckodriver
For default search on package name only, we rescript filtering to
--nameonly:$ eopkg --no-color search firefox --name firefox - Firefox web browser eid-mw-firefox - Belgian eID add-on for Mozilla Firefox firefox-dbginfo - Debug symbols for firefox
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ sudo eopkg --no-color install --yes-all 0ad Warning: Updates available, checking reverse dependencies of runtime dependencies for safety. Following packages will be installed: 0ad 0ad-data assimp at-spi2 baobab breeze-icons budgie-control-center budgie-desktop dav1d enet evolution-data-server ffmpeg file-roller firefox fmt fontconfig gcr-4 gloox gnome-calculator gnome-calendar gnome-online-accounts gnome-settings-daemon gnome-system-monitor gnome-terminal gvfs harfbuzz ibus kf6-karchive kf6-kauth kf6-kbookmarks kf6-kcodecs kf6-kcolorscheme kf6-kcompletion kf6-kconfig kf6-kconfigwidgets kf6-kcoreaddons kf6-kcrash kf6-kdbusaddons kf6-kded kf6-kdoctools kf6-kglobalaccel kf6-kguiaddons kf6-ki18n kf6-kiconthemes kf6-kio kf6-kitemviews kf6-kjobwidgets kf6-knotifications kf6-kparts kf6-kservice kf6-kwallet kf6-kwidgetsaddons kf6-kwindowsystem kf6-kxmlgui kf6-solid kpmcore ldb libadwaita libarchive libass libcheese libgtk-4 libgtkmm-4 libgtksourceview5 libheif libpng libportal libportal-gtk4 libreoffice-common librsvg libsodium libtiff libtool libvte libwebkit-gtk41 libwebkit-gtk6 lzo mesalib miniupnpc nautilus-extension nemo network-manager networkmanager-openconnect openconnect pipewire pipewire-lib pixman poppler poppler-utils postgresql-libpq python-pysmbc qt6-base qt6-declarative qt6-multimedia qt6-quick3d qt6-quicktimeline qt6-wayland rav1e rhythmbox samba sdl2 svt-av1 thunderbird wayland xapp xmlsec1 xorg-server xorg-xwayland xreader xviewer zenity Total size of package(s): 1.94 GB Downloading 1 / 111 Package ldb found in repository Solus ldb-2.8.2-31-1-x86_64.eopkg (137.0 KB)100% 0.00 --/- [--:--:--] [complete] (...) Package 0ad-data found in repository Solus 0ad-data-0.0.26a-10-1-x86_64.eopkg (1.4 GB) 39% (...)
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ sudo eopkg --no-color upgrade --yes-all
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ sudo eopkg --no-color upgrade --yes-all xz Updating repositories Updating repository: Solus eopkg-index.xml.xz.sha1sum (40.0 B)100% 0.00 --/- [--:--:--] [complete] Solus repository information is up-to-date. Warning: Safety switch forces the installation of following packages: os-release Warning: Safety switch forces the upgrade of following packages: bash bash-completion brotli eopkg gawk glib2 glibc gobject-introspection hwdata json-c libcap2 libdw libelf libjson-glib libnspr libnss libpipeline libssh2 libunistring lvm2 lzip ncurses nghttp2 nghttp3 pisi readline sqlite3 systemd wireless-regdb xz Total size of package(s): 55.40 MB Warning: There are extra packages due to dependencies. Downloading 1 / 32 Package ncurses found in repository Solus ncurses-6.5.20241006-29-1-x86_64.eopkg (767.0 KB)100% 0.00 --/- [--:--:--] [complete] (...) [β] Syncing filesystems success [β] Updating dynamic library cache success [ ] Updating clr-boot-manager skipped [ ] Updating clr-boot-manager skipped [ ] Updating clr-boot-manager skipped [ ] Updating clr-boot-manager skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [β] Updating hwdb success [β] Updating system users success [β] Updating systemd tmpfiles success [β] Reloading systemd configuration success [ ] Re-starting vendor-enabled .socket units skipped [ ] Re-executing systemd skipped [β] Compiling glib-schemas success [β] Creating GIO modules cache success [β] Updating manpages database success [β] Reloading udev rules success [β] Applying udev rules success
- remove(package_id)[source]ΒΆ
Remove one package.
$ sudo eopkg --no-color remove --yes-all firefox The following list of packages will be removed in the respective order to satisfy dependencies: firefox Removing package firefox Rebuilding the FilesDB... Adding packages to FilesDB /var/lib/eopkg/info/files.db: ................ 847 packages added in total. Done rebuilding FilesDB (version: 3) Removed firefox [β] Syncing filesystems success [β] Updating dynamic library cache success [ ] Updating clr-boot-manager skipped [ ] Updating clr-boot-manager skipped [ ] Updating clr-boot-manager skipped [ ] Updating clr-boot-manager skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Registering QoL migration on next boot skipped [ ] Re-starting vendor-enabled .socket units skipped [ ] Re-executing systemd skipped [β] Updating icon theme cache: hicolor success [β] Updating desktop database success [β] Updating manpages database success
- Return type:
- sync()[source]ΒΆ
Sync package metadata.
$ sudo eopkg --no-color update-repo Updating repository: Solus eopkg-index.xml.xz.sha1sum (40.0 B)100% 0.00 --/- [--:--:--] [complete] eopkg-index.xml.xz (3.1 MB)100% 87.40 KB/s [00:00:34] [complete] Package database updated.
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore: - orphaned packages, - outdated package locks - package cache and package manager cache
$ sudo eopkg --no-color remove-orphans --yes-all $ sudo eopkg --no-color clean $ sudo eopkg --no-color delete-cache
- Return type:
- cli_names: tuple[str, ...] = ('eopkg',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
meta_package_manager.managers.flatpak moduleΒΆ
- class meta_package_manager.managers.flatpak.Flatpak[source]ΒΆ
Bases:
PackageManagerFlatpak manages sandboxed desktop applications pulled from remotes like Flathub.
mpm covers applications only: every listing passes
--app, so runtimes and SDKs stay out of scope. Listings are requested with--columns=name,application,version --ostree-verboseand parsed as tab-separated rows.Note
All operations target the system-wide scope except
cleanupwhich only repairs the user installation. Per-scope targeting (system vs user) is tracked in #1725.Caution
outdatedreads each pending updateβs latest version fromremote-ls --updates, then runs oneflatpak infoper package to recover its installed version: a follow-up CLI call for every outdated app.Note
Brewfile backups emit the bare
flatpak "id"form: mpm does not capture each appβs origin remote, sobrew bundle installrestores through Flathub and non-Flathub apps must be edited in by hand.Initialize
cli_errorslist.- homepage_url: str | None = 'https://flatpak.org'ΒΆ
Home page of the project, only used in documentation for reference.
- brewfile_entry_type: ClassVar[str | None] = 'flatpak'ΒΆ
Mapped to Homebrew Bundleβs
flatpakextension.The Brewfile
flatpakentry supports awith: ["remote"]keyword for non-default remotes. mpmβsinstalled()does not currently capture the origin remote per package, so the dump emits the bareflatpak "id"form;brew bundle installthen resolves through the defaultflathubremote. Non-flathub flatpaks need to be edited in by hand after the dump.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=1.2.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- version_regexes: tuple[str, ...] = ('Flatpak\\s+(?P<version>\\S+)',)ΒΆ
$ flatpak --version Flatpak 1.4.2
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ flatpak list --app --columns=name,application,version > --ostree-verbose Peek com.uploadedlobster.peek 1.3.1 Fragments de.haeckerfelix.Fragments 1.4 GNOME MPV io.github.GnomeMpv 0.16 Syncthing GTK me.kozec.syncthingtk v0.9.4.3 Builder org.flatpak.Builder
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ flatpak remote-ls --app --updates --columns=name,application,version --ostree-verbose GNOME Dictionary org.gnome.Dictionary 3.26.0 Files org.gnome.Nautilus 42.2
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not support extended or exact matching. So we return the best subset of results and let
meta_package_manager.manager.PackageManager.refiltered_search()refine them.$ flatpak search gitg --ostree-verbose gitg GUI for git org.gnome.gitg 3.32.1 stable flathub
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ flatpak install --noninteractive org.gnome.Dictionary
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ flatpak update --noninteractive
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ flatpak update --noninteractive org.gnome.Dictionary
- cli_names: tuple[str, ...] = ('flatpak',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'flatpak'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- name: str = 'Flatpak'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- remove(package_id)[source]ΒΆ
Remove one package.
$ flatpak uninstall --noninteractive org.gnome.Dictionary
- Return type:
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
See: https://docs.flatpak.org/en/latest/flatpak-command-reference.html#flatpak-repair
$ flatpak repair --user
- Return type:
meta_package_manager.managers.fwupd moduleΒΆ
- class meta_package_manager.managers.fwupd.FWUPD[source]ΒΆ
Bases:
PackageManagerfwupd manages device firmware, treating each updatable device as a package.
Firmware inventory and updates come from the LVFS (Linux Vendor Firmware Service). Each package is keyed by its fwupd
DeviceId, carrying the device name and current firmware version. mpm drivesfwupdmgrin JSON mode (get-devices --json,get-updates --json), which sets the version floor at1.9.5: the first release to emit JSON forget-devices.Note
installedandoutdatedreport only devices carrying theupdatableflag: fixed or unsupported hardware is skipped even thoughfwupdmgrstill lists it.Note
No
search(firmware has no name catalog to query) and noremove(firmware cannot be uninstalled). Flashing runs as root and is forced non-interactive: no confirmation prompt, no reboot check, no device-selection prompt.Initialize
cli_errorslist.- name: str = 'Linux fwupd'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://fwupd.org'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- requirement: str | None = '>=1.9.5'ΒΆ
Version 1.9.5 is the first supporting βjson parameter for get-devices command.
- cli_names: tuple[str, ...] = ('fwupdmgr',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- version_regexes: tuple[str, ...] = ('compile\\s+org\\.freedesktop\\.fwupd\\s+(?P<version>\\S+)\\s+',)ΒΆ
$ fwupdmgr --version compile com.hughsie.libxmlb 0.3.18 compile com.hughsie.libjcat 0.2.0 compile org.freedesktop.fwupd 1.9.24 runtime org.freedesktop.fwupd-efi 1.4 compile org.freedesktop.gusb 0.4.8 runtime com.hughsie.libxmlb 0.3.x runtime org.freedesktop.gusb 0.4.8 runtime com.hughsie.libjcat 0.2.0 runtime org.freedesktop.fwupd 1.9.24 runtime org.kernel 6.8.0-48-generic
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ fwupdmgr --assume-yes --no-reboot-check --no-device-prompt get-devices --json { "Devices": [ { "Name": "USB2.0 Hub", "DeviceId": "7622d5fdbf1d1e08138156da7d83bf693986ad16", "ParentDeviceId" : "b5540761dfe33d9abccd3bb21f1d725f9e69f541", "CompositeId" : "b5540761dfe33d9abccd3bb21f1d725f9e69f541", "InstanceIds": [ "USB\VID_17EF&PID_3080", "USB\VID_17EF&PID_3080&REV_5163", "USB\VID_17EF&PID_3080&HUB_20", "USB\VID_17EF&PID_3080&SPI_C220", "USB\VID_17EF&PID_3080&SPI_C220&REV_5163", "USB\VID_17EF&PID_3080&DEV_VL820Q7" ], "Guid": [ "8ee94f0e-9b44-596a-bdd9-6f90401664cc", "35199e34-cf82-5b09-9287-622d225056e4", "0987e3c9-b1ee-5763-ac6e-51329b034e4b", "163cea66-5a78-58af-80ba-21be960aae5c", "c7def18d-66ae-5531-924b-2020c3638181" ], "Summary": "USB 3.x hub", "Plugin": "vli", "Protocol" : "com.vli.usbhub", "Flags": [ "updatable", "registered", "can-verify", "can-verify-image", "dual-image", "self-recovery", "add-counterpart-guids", "unsigned-payload" ], "Vendor": "VIA Labs, Inc.", "VendorId" : "USB:0x17EF", "Version": "51.63", "VersionFormat" : "bcd", "VersionRaw": 20835, "Icons": [ "usb-hub" ], "InstallDuration" : 15, "Created": 1686048073 }, { "DeviceId" : "20de1d77d0d1787bc56ef62f7d05de49361e1e07", "InstanceIds" : [ "DRM\VEN_RHT&DEV_1234" ], "Guid" : [ "90b1437c-86da-5374-a9a7-ceca8b0afd5e" ], "Plugin" : "linux_display", "Flags" : [ "registered" ], "Created" : 1731659840 }, { "Name" : "UEFI dbx", "DeviceId" : "362301da643102b9f38477387e2193e57abaa590", "InstanceIds" : [ "UEFI\CRT_E1FFABB40A30D9EE750BDA8BAF36ACA304FF20526138129247576B3339C54537&ARCH_AA64", "UEFI\CRT_A1117F516A32CEFCBA3F2D1ACE10A87972FD6BBE8FE0D0B996E09E65D802A503&ARCH_AA64" ], "Guid" : [ "a9b31b16-b184-560f-97cb-1aa25e418c7d", "67d35028-ca5b-5834-834a-f97380381082" ], "Summary" : "UEFI revocation database", "Plugin" : "uefi_dbx", "Protocol" : "org.uefi.dbx", "Flags" : [ "internal", "updatable", "supported", "registered", "needs-reboot", "usable-during-update", "only-version-upgrade", "signed-payload" ], "Checksums" : [ "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], "VendorId" : "UEFI:Linux Foundation", "Version" : "0", "VersionLowest" : "0", "VersionFormat" : "number", "Icons" : [ "computer" ], "InstallDuration" : 1, "Created" : 1731659840, "Releases" : [ { "AppstreamId" : "org.linuxfoundation.dbx.aa64.firmware", "ReleaseId" : "35289", "RemoteId" : "lvfs", "Name" : "Secure Boot dbx", "NameVariantSuffix" : "aa64", "Summary" : "UEFI Secure Boot Forbidden Signature Database", "Description" : "<p>Insecure versions of the Microsoft Windows boot manager affected by Black Lotus were added to the list of forbidden signatures due to a discovered security problem.This updates the dbx to the latest release from Microsoft.</p><p>Before installing the update, fwupd will check for any affected executables in the ESP and will refuse to update if it finds any boot binaries signed with any of the forbidden signatures.Applying this update may also cause some Windows install media to not start correctly.</p>", "Version" : "26", "Filename" : "DBXUpdate-20230509-aa64.cab", "Protocol" : "org.uefi.dbx", "Categories" : [ "X-Configuration", "X-System" ], "Issues" : [ "CVE-2022-21894" ], "Checksum" : [ "46a42362cd34c0d103cf534ca431508d24715e51", "3ff3f17a9e5d372e51503803f22294f32ca90d1fe570b0bef4088c3a542617e6" ], "License" : "LicenseRef-proprietary", "Size" : 4610, "Created" : 1683590400, "Locations" : [ "https://fwupd.org/downloads/3ff3f17a9e5d372e51503803f22294f32ca90d1fe570b0bef4088c3a542617e6-DBXUpdate-20230509-aa64.cab" ], "Uri" : "https://fwupd.org/downloads/3ff3f17a9e5d372e51503803f22294f32ca90d1fe570b0bef4088c3a542617e6-DBXUpdate-20230509-aa64.cab", "Homepage" : "https://uefi.org/revocationlistfile", "Vendor" : "Linux Foundation", "Flags" : [ "trusted-metadata", "is-upgrade" ], "InstallDuration" : 1 }, { "AppstreamId" : "org.linuxfoundation.dbx.aa64.firmware", "ReleaseId" : "28503", "RemoteId" : "lvfs", "Name" : "Secure Boot dbx", "NameVariantSuffix" : "aa64", "Summary" : "UEFI Secure Boot Forbidden Signature Database", "Description" : "<p>An insecure version of software from vmware has been added to the list of forbidden signatures due to a discovered security problem.This updates the dbx to the latest release from Microsoft.</p><p>Before installing the update, fwupd will check for any affected executables in the ESP and will refuse to update if it finds any boot binaries signed with any of the forbidden signatures.</p>", "Version" : "22", "Filename" : "DBXUpdate-20230314-aa64.cab", "Protocol" : "org.uefi.dbx", "Categories" : [ "X-Configuration", "X-System" ], "Issues" : [ "CVE-2023-28005" ], "Checksum" : [ "611e745638f05e9a11c2998cfba38f0bad651141", "533ce4ac028585925268d9e39079b71730a7abd94f611bc532707938d4271ad3" ], "License" : "LicenseRef-proprietary", "Size" : 4418, "Created" : 1678752000, "Locations" : [ "https://fwupd.org/downloads/533ce4ac028585925268d9e39079b71730a7abd94f611bc532707938d4271ad3-DBXUpdate-20230314-aa64.cab" ], "Uri" : "https://fwupd.org/downloads/533ce4ac028585925268d9e39079b71730a7abd94f611bc532707938d4271ad3-DBXUpdate-20230314-aa64.cab", "Homepage" : "https://uefi.org/revocationlistfile", "Vendor" : "Linux Foundation", "Flags" : [ "trusted-metadata", "is-upgrade" ], "InstallDuration" : 1 }, { "AppstreamId" : "org.linuxfoundation.dbx.aa64.firmware", "ReleaseId" : "15180", "RemoteId" : "lvfs", "Name" : "Secure Boot dbx", "NameVariantSuffix" : "aa64", "Summary" : "UEFI Secure Boot Forbidden Signature Database", "Description" : "<p>This updates the dbx to the latest release from Microsoft which adds insecure versions of grub and shim to the list of forbidden signatures due to multiple discovered security updates.</p>", "Version" : "21", "Filename" : "DBXUpdate-20220812-aa64.cab", "Protocol" : "org.uefi.dbx", "Categories" : [ "X-Configuration", "X-System" ], "Issues" : [ "CVE-2022-34303", "309662", "CVE-2022-34302", "CVE-2022-34301" ], "Checksum" : [ "4032a1d8734e6085f4a6e4bb26a038eb639603b9", "bf56092de6586604d2b41d5bb4c9b7787a07adde408fd4134a3f3606f7fda999" ], "License" : "LicenseRef-proprietary", "Size" : 4370, "Created" : 1595980800, "Locations" : [ "https://fwupd.org/downloads/bf56092de6586604d2b41d5bb4c9b7787a07adde408fd4134a3f3606f7fda999-DBXUpdate-20220812-aa64.cab" ], "Uri" : "https://fwupd.org/downloads/bf56092de6586604d2b41d5bb4c9b7787a07adde408fd4134a3f3606f7fda999-DBXUpdate-20220812-aa64.cab", "Homepage" : "https://uefi.org/revocationlistfile", "Vendor" : "Linux Foundation", "Flags" : [ "trusted-metadata", "is-upgrade" ], "InstallDuration" : 1 } ] }, { "Name" : "Virtio network device", "DeviceId" : "17076870bcf7a84a9c8e999d7e54e39b446032bb", "InstanceIds" : [ "PCI\VEN_1AF4&DEV_1000", "PCI\VEN_1AF4&DEV_1000&SUBSYS_1AF40001" ], "Guid" : [ "21c85fac-5270-576f-a84e-04969f8cf75a", "b93ef629-0df1-5505-9fee-6992b8b9abd8" ], "Plugin" : "optionrom", "Flags" : [ "internal", "registered", "can-verify", "can-verify-image" ], "Vendor" : "Red Hat, Inc.", "VendorId" : "PCI:0x1AF4", "Created" : 1731659840 } ] }
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ fwupdmgr --assume-yes --no-reboot-check --no-device-prompt get-updates --json { "Devices" : [ { "Name" : "UEFI dbx", "DeviceId" : "362301da643102b9f38477387e2193e57abaa590", "InstanceIds" : [ "UEFI\CRT_E1FFABB40A30D9EE750BDA8BAF36ACA304FF20526138129247576B3339C54537&ARCH_AA64", "UEFI\CRT_A1117F516A32CEFCBA3F2D1ACE10A87972FD6BBE8FE0D0B996E09E65D802A503&ARCH_AA64" ], "Guid" : [ "a9b31b16-b184-560f-97cb-1aa25e418c7d", "67d35028-ca5b-5834-834a-f97380381082" ], "Summary" : "UEFI revocation database", "Plugin" : "uefi_dbx", "Protocol" : "org.uefi.dbx", "Flags" : [ "internal", "updatable", "supported", "registered", "needs-reboot", "usable-during-update", "only-version-upgrade", "signed-payload" ], "Checksums" : [ "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], "VendorId" : "UEFI:Linux Foundation", "Version" : "0", "VersionLowest" : "0", "VersionFormat" : "number", "Icons" : [ "computer" ], "InstallDuration" : 1, "Created" : 1731659840, "Releases" : [ { "AppstreamId" : "org.linuxfoundation.dbx.aa64.firmware", "ReleaseId" : "35289", "RemoteId" : "lvfs", "Name" : "Secure Boot dbx", "NameVariantSuffix" : "aa64", "Summary" : "UEFI Secure Boot Forbidden Signature Database", "Description" : "<p>Insecure versions of the Microsoft Windows boot manager affected by Black Lotus were added to the list of forbidden signatures due to a discovered security problem.This updates the dbx to the latest release from Microsoft.</p><p>Before installing the update, fwupd will check for any affected executables in the ESP and will refuse to update if it finds any boot binaries signed with any of the forbidden signatures.Applying this update may also cause some Windows install media to not start correctly.</p>", "Version" : "26", "Filename" : "DBXUpdate-20230509-aa64.cab", "Protocol" : "org.uefi.dbx", "Categories" : [ "X-Configuration", "X-System" ], "Issues" : [ "CVE-2022-21894" ], "Checksum" : [ "46a42362cd34c0d103cf534ca431508d24715e51", "3ff3f17a9e5d372e51503803f22294f32ca90d1fe570b0bef4088c3a542617e6" ], "License" : "LicenseRef-proprietary", "Size" : 4610, "Created" : 1683590400, "Locations" : [ "https://fwupd.org/downloads/3ff3f17a9e5d372e51503803f22294f32ca90d1fe570b0bef4088c3a542617e6-DBXUpdate-20230509-aa64.cab" ], "Uri" : "https://fwupd.org/downloads/3ff3f17a9e5d372e51503803f22294f32ca90d1fe570b0bef4088c3a542617e6-DBXUpdate-20230509-aa64.cab", "Homepage" : "https://uefi.org/revocationlistfile", "Vendor" : "Linux Foundation", "Flags" : [ "trusted-metadata", "is-upgrade" ], "InstallDuration" : 1 }, { "AppstreamId" : "org.linuxfoundation.dbx.aa64.firmware", "ReleaseId" : "28503", "RemoteId" : "lvfs", "Name" : "Secure Boot dbx", "NameVariantSuffix" : "aa64", "Summary" : "UEFI Secure Boot Forbidden Signature Database", "Description" : "<p>An insecure version of software from vmware has been added to the list of forbidden signatures due to a discovered security problem.This updates the dbx to the latest release from Microsoft.</p><p>Before installing the update, fwupd will check for any affected executables in the ESP and will refuse to update if it finds any boot binaries signed with any of the forbidden signatures.</p>", "Version" : "22", "Filename" : "DBXUpdate-20230314-aa64.cab", "Protocol" : "org.uefi.dbx", "Categories" : [ "X-Configuration", "X-System" ], "Issues" : [ "CVE-2023-28005" ], "Checksum" : [ "611e745638f05e9a11c2998cfba38f0bad651141", "533ce4ac028585925268d9e39079b71730a7abd94f611bc532707938d4271ad3" ], "License" : "LicenseRef-proprietary", "Size" : 4418, "Created" : 1678752000, "Locations" : [ "https://fwupd.org/downloads/533ce4ac028585925268d9e39079b71730a7abd94f611bc532707938d4271ad3-DBXUpdate-20230314-aa64.cab" ], "Uri" : "https://fwupd.org/downloads/533ce4ac028585925268d9e39079b71730a7abd94f611bc532707938d4271ad3-DBXUpdate-20230314-aa64.cab", "Homepage" : "https://uefi.org/revocationlistfile", "Vendor" : "Linux Foundation", "Flags" : [ "trusted-metadata", "is-upgrade" ], "InstallDuration" : 1 }, { "AppstreamId" : "org.linuxfoundation.dbx.aa64.firmware", "ReleaseId" : "15180", "RemoteId" : "lvfs", "Name" : "Secure Boot dbx", "NameVariantSuffix" : "aa64", "Summary" : "UEFI Secure Boot Forbidden Signature Database", "Description" : "<p>This updates the dbx to the latest release from Microsoft which adds insecure versions of grub and shim to the list of forbidden signatures due to multiple discovered security updates.</p>", "Version" : "21", "Filename" : "DBXUpdate-20220812-aa64.cab", "Protocol" : "org.uefi.dbx", "Categories" : [ "X-Configuration", "X-System" ], "Issues" : [ "CVE-2022-34303", "309662", "CVE-2022-34302", "CVE-2022-34301" ], "Checksum" : [ "4032a1d8734e6085f4a6e4bb26a038eb639603b9", "bf56092de6586604d2b41d5bb4c9b7787a07adde408fd4134a3f3606f7fda999" ], "License" : "LicenseRef-proprietary", "Size" : 4370, "Created" : 1595980800, "Locations" : [ "https://fwupd.org/downloads/bf56092de6586604d2b41d5bb4c9b7787a07adde408fd4134a3f3606f7fda999-DBXUpdate-20220812-aa64.cab" ], "Uri" : "https://fwupd.org/downloads/bf56092de6586604d2b41d5bb4c9b7787a07adde408fd4134a3f3606f7fda999-DBXUpdate-20220812-aa64.cab", "Homepage" : "https://uefi.org/revocationlistfile", "Vendor" : "Linux Foundation", "Flags" : [ "trusted-metadata", "is-upgrade" ], "InstallDuration" : 1 } ] } ] }
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ sudo fwupdmgr --assume-yes --no-reboot-check --no-device-prompt install 362301da643102b9f38477387e2193e57abaa590 WARNING: UEFI capsule updates not available or enabled in firmware setup See https://github.com/fwupd/fwupd/wiki/PluginFlag:capsules-unsupported for more information. 0. Cancel 1. 26 2. 22 3. 21 Choose release [0-3]: 3 Scheduling⦠[***************************************] Successfully installed firmware $ sudo fwupdmgr --assume-yes --no-reboot-check --no-device-prompt install 362301da643102b9f38477387e2193e57abaa590 21 WARNING: UEFI capsule updates not available or enabled in firmware setup See https://github.com/fwupd/fwupd/wiki/PluginFlag:capsules-unsupported for more information. Scheduling⦠[***************************************] 362301da643102b9f38477387e2193e57abaa590 is already scheduled to be updated
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ sudo fwupdmgr --assume-yes --no-reboot-check --no-device-prompt update
- id: str = 'fwupd'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the package provided as parameter.
$ sudo fwupdmgr --assume-yes --no-reboot-check --no-device-prompt update 362301da643102b9f38477387e2193e57abaa590 WARNING: UEFI capsule updates not available or enabled in firmware setup See https://github.com/fwupd/fwupd/wiki/PluginFlag:capsules-unsupported for more information. Scheduling⦠[ - ] 362301da643102b9f38477387e2193e57abaa590 is already scheduled to be updated
meta_package_manager.managers.gem moduleΒΆ
- class meta_package_manager.managers.gem.Gem[source]ΒΆ
Bases:
PackageManagerThe RubyGems package manager.
gem emits no machine-readable format, so installed, outdated and search listings are parsed from its text output. A gem can keep several versions installed side by side (
molinillo (0.5.4, 0.4.5, 0.2.3)); mpm reports the highest as the installed version.Note
All operations target the default gem scope (controlled by
GEM_HOME). On system Ruby this means system-level gems, which may require elevated privileges for write operations. Per-scope targeting (system vs user gems) is tracked in #1725.Tip
Installs require
sudoon system ruby. I (@tresni) recommend doing something like:$ sudo dseditgroup -o edit -a -t user wheel
And then do
visudoto make it so thewheelgroup does not require a password. There is a line already there for it, you just need to uncomment it and save.Initialize
cli_errorslist.- name: str = 'RubyGems'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://rubygems.org'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- post_args: tuple[str, ...] = ('--quiet',)ΒΆ
Global list of options used before and after the invoked package manager CLI.
Automatically added to each
meta_package_manager.manager.PackageManager.run_cli()call.Essentially used to force silencing, low verbosity or no-color output.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ gem list --quiet bigdecimal (default: 1.4.1) bundler (default: 1.17.2) CFPropertyList (2.3.6) cmath (default: 1.0.0) csv (default: 3.0.9) date (default: 2.0.0) fileutils (1.4.1, default: 1.1.0) io-console (0.5.6, default: 0.4.7) ipaddr (default: 1.2.2) molinillo (0.5.4, 0.4.5, 0.2.3) nokogiri (1.5.6) psych (2.0.0) rake (0.9.6) rdoc (4.0.0) sqlite3 (1.3.7) test-unit (2.0.0.0)
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ gem outdated --quiet did_you_mean (1.0.0 < 1.0.2) io-console (0.4.5 < 0.4.6) json (1.8.3 < 2.0.1) minitest (5.8.3 < 5.9.0) power_assert (0.2.6 < 0.3.0) psych (2.0.17 < 2.1.0)
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not supports extended mode.
$ gem search python --versions --quiet at_coder_friends-generator-python_ref (0.2.0) bee_python (0.2.3) dependabot-python (0.117.5) logstash-filter-python (0.0.1 java) python (0.0.1) python-generator (1.1.0) python_with_git_test (2.499.8) rabbit-slide-niku-erlangvm-for-pythonista (2015.09.12) RubyToPython (0.0)
$ gem search python --versions --exact --quiet python (0.0.1)
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ gem install --quiet markdown Fetching kramdown-2.3.1.gem Fetching concurrent-ruby-1.1.9.gem (...) Fetching rubyzip-2.3.2.gem Fetching logutils-0.6.1.gem Fetching markdown-1.2.0.gem Successfully installed kramdown-2.3.1 Successfully installed rubyzip-2.3.2 (...) Successfully installed markdown-1.2.0 (...) Parsing documentation for markdown-1.2.0 Installing ri documentation for markdown-1.2.0 Done installing documentation for (...) markdown after 19 seconds 12 gems installed
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ gem update --quiet
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ gem update --quiet markdown
- remove(package_id)[source]ΒΆ
Remove one package.
$ gem uninstall left-pad --quiet Successfully uninstalled left-pad-1.1.0
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
$ gem cleanup --quiet Cleaning up installed gems... Attempting to uninstall test-unit-3.2.9 Unable to uninstall test-unit-3.2.9: Gem::FilePermissionError: You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory. Attempting to uninstall did_you_mean-1.3.0 Unable to uninstall did_you_mean-1.3.0: Gem::FilePermissionError: You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory. Clean up complete
- Return type:
- cli_names: tuple[str, ...] = ('gem',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
meta_package_manager.managers.guix moduleΒΆ
- class meta_package_manager.managers.guix.Guix[source]ΒΆ
Bases:
PackageManagerGNU Guix, GNUβs functional package manager.
Note
All operations target the current userβs default profile. Declarative system configuration (Guix System
config.scm) is not covered.Guix is a rolling release with no upstream semver to pin against:
guix --versionreports a release tag, agit describestring, or the bare commit hash of an in-tree checkout. Norequirementfloor is enforced, since any workingguixwill do.Warning
searchevaluates every package definition to match the query, so its cost scales with the size of the package set, not the result count: tens of seconds on a freshly pulled Guix, longer still from an in-tree development checkout. The call is bounded bympm --timeout(120s by default), past which it is killed with no results returned, so a slow search can look like a hang.Initialize
cli_errorslist.- name: str = 'GNU Guix'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://guix.gnu.org'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- version_regexes: tuple[str, ...] = ('guix \\(GNU Guix\\) (?P<version>\\d[\\w.\\-+]*)', 'guix \\(GNU Guix\\) (?P<version>[0-9a-f]{7,40})\\b')ΒΆ
$ guix --version guix (GNU Guix) 1.4.0
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
Output is tab-separated: name, version, output, store path.
$ guix package --list-installed hello 2.10 out /gnu/store/k74skdjjb9c9zqjv9nmgd6zi92wpf3q0-hello-2.10 python 3.10.7 out /gnu/store/2n3g8n7d5xkp6h4qz1v8m0rjc9wf5aby-python-3.10.7
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
Relies on
guix upgrade --dry-runwhich lists every package that would be upgraded without modifying the user profile.$ guix upgrade --dry-run The following packages would be upgraded: hello 2.12.1 β 2.12.3 sed 4.8 β 4.9
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not support extended or exact matching. So we return the best subset of results and let
meta_package_manager.manager.PackageManager.refiltered_search()refine them.Caution
guix searchloads and evaluates every package definition to match the query against each packageβs name, synopsis, and description, so it is inherently slow: its cost scales with the size of the package set, not the number of results. A single search runs for tens of seconds on a freshly pulled Guix, and far longer from an in-tree dev checkout that recompiles modules on the fly. The call is bounded bympm --timeout; when that is unset,searchuses the 120s read-only default, past which the process is killed and no results are returned, so a slow search can look like a hang.Results are printed in recutils format with records separated by blank lines.
$ guix search hello name: hello version: 2.10 outputs: out systems: x86_64-linux i686-linux dependencies: glibc@2.35 ... location: gnu/packages/base.scm:86:2 homepage: https://www.gnu.org/software/hello/ license: GPL 3+ synopsis: Hello, GNU world: an example GNU package description: GNU Hello prints the message "Hello, world!" + and then exits. It serves as an example of standard + GNU coding practices. relevance: 10
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade one package.
$ guix upgrade hello
- cli_names: tuple[str, ...] = ('guix',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'guix'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
meta_package_manager.managers.homebrew moduleΒΆ
- class meta_package_manager.managers.homebrew.Homebrew[source]ΒΆ
Bases:
PackageManagerVirtual base shared by the
BrewandCaskmanagers.Homebrew is the umbrella project behind the
brewCLI. mpm exposes it as two managers over that single binary:Brewfor formulae built from recipes, andCaskfor pre-built macOS applications, each pinning its half with a--formulaor--caskselector. This base holds the shared query, mutation and metadata logic; the concrete classes carry the manager-level narrative.Initialize
cli_errorslist.- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
Homebrew core is now compatible with Linux and Windows Subsystem for Linux (WSL) 2.
- requirement: str | None = '>=6.0.0'ΒΆ
Vanilla
brewandcaskCLIs now shares the same version.2.7.0 was the first release to enforce the use of
--caskoption.6.0.0 is the first release in which ask mode is the default for
brew installandbrew upgrade, and the first to ship the--yesopt-out flag that mpm relies on for non-interactive upgrades.
- virtual: bool = TrueΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- extra_env: ClassVar = {'HOMEBREW_NO_ANALYTICS': '1', 'HOMEBREW_NO_AUTO_UPDATE': '1', 'HOMEBREW_NO_ENV_HINTS': '1'}ΒΆ
Additional environment variables to add to the current context.
Automatically applied on each
meta_package_manager.manager.PackageManager.run_cli()calls.
- version_regexes: tuple[str, ...] = ('Homebrew\\s+(?P<version>\\S+)',)ΒΆ
$ brew --version Homebrew 1.8.6-124-g6cd4c31 Homebrew/homebrew-core (git revision 533d; last commit 2018-12-28) Homebrew/homebrew-cask (git revision 5095b; last commit 2018-12-28)
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ brew list --versions --formula ack 2.14 apg 2.2.3 audacity (!) 2.1.2 apple-gcc42 4.2.1-5666.3 atk 2.22.0 bash 4.4.5 bash-completion 1.3_1 boost 1.63.0 c-ares 1.12.0 graphviz 2.40.1 2.40.20161221.0239 quicklook-json latest
$ brew list --versions --cask aerial 1.2beta5 android-file-transfer latest audacity (!) 2.1.2 firefox 49.0.1 flux 37.7 gimp 2.8.18-x86_64 java 1.8.0_112-b16 tunnelblick 3.6.8_build_4625 3.6.9_build_4685 virtualbox 5.1.8-111374 5.1.10-112026
Todo
Use the
removedvariable to detect removed packages (which are reported with a(!)flag). See: https://github.com/caskroom/homebrew-cask/blob/master/doc /reporting_bugs/uninstall_wrongly_reports_cask_as_not_installed.md and https://github.com/kdeldycke/meta-package-manager/issues/17 .
- package_metadata_batch(packages)[source]ΒΆ
Enrich installed packages with Homebrewβs API + per-formula data.
Runs
brew info --json=v2 --installedin a single shell-out and joins the result back onto the inventory list by package ID. For each formula that has<prefix>/Cellar/<name>/<version>/sbom.spdx.jsonon disk (the file Homebrew writes when installed underHOMEBREW_SBOM=1), the metadataβsexternal_sbom_pathpoints at it so the SPDX renderer can splice the upstream document into the aggregate.Casks reuse the same JSON payload through the
casksarray but do not get the SBOM-file treatment (Homebrew does not emit one for casks).- Return type:
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ brew outdated --json=v2 --formula | jq { "formulae": [ { "name": "pygobject3", "installed_versions": [ "3.36.1" ], "current_version": "3.38.0", "pinned": false, "pinned_version": null }, { "name": "rav1e", "installed_versions": [ "0.3.3" ], "current_version": "0.3.4", "pinned": false, "pinned_version": null } ], "casks": [] }
$ brew outdated --json=v2 --cask | jq { "formulae": [], "casks": [ { "name": "electrum", "installed_versions": "4.0.2", "current_version": "4.0.3" }, { "name": "qlcolorcode", "installed_versions": "3.0.2", "current_version": "3.1.1" } ] }
$ brew outdated --json=v2 --greedy --cask | jq { "formulae": [], "casks": [ { "name": "amethyst", "installed_versions": "0.14.3", "current_version": "0.15.3" }, { "name": "balenaetcher", "installed_versions": "1.5.106", "current_version": "1.5.108" }, { "name": "caldigit-thunderbolt-charging", "installed_versions": "latest", "current_version": "latest" }, { "name": "electrum", "installed_versions": "4.0.2", "current_version": "4.0.3" }, { "name": "lg-onscreen-control", "installed_versions": "5.33,cV8xqv5TSZA.upgrading, 5.47,yi5XuIZw6hg", "current_version": "5.48,uYXSwyUCNFBbSch9PFw" } ] }
Note
Both the formula and cask payloads also carry
pinnedandpinned_versionfields. The formula payload has always emitted them; the cask payload has emitted them since at least5.1.15but they only became meaningful with Homebrew 6.0.0, which added brew pin <cask> so casks can now actually be pinned.mpmdiscards both fields today: pinned packages still appear inmpm outdatedoutput, andbrew upgradesilently skips them at upgrade time. Track this gap if a futurempmrelease wants to surface or filter on pin state.
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not supports extended mode.
$ brew search sed ==> Formulae gnu-sed β libxdg-basedir ==> Casks eclipse-dsl marsedit focused physicseditor google-adwords-editor prefs-editor licensed subclassed-mnemosyne
$ brew search sed --formulae ==> Formulae gnu-sed β libxdg-basedir
$ brew search sed --cask ==> Casks eclipse-dsl marsedit focused physicseditor google-adwords-editor prefs-editor licensed subclassed-mnemosyne
$ brew search python --formulae ==> Formulae app-engine-python boost-python3 python β python-yq boost-python gst-python python-markdown python@3.8 β
$ brew search "/^ssed$/" --formulae ==> Formulae ssed
$ brew search "/^sed$/" --formulae Error: No formula or cask found for "/^sed$/".
$ brew search tetris --formulae --desc ==> Formulae bastet: Bastard Tetris netris: Networked variant of tetris vitetris: Terminal-based Tetris clone yetris: Customizable Tetris for the terminal
$ brew search tetris --cask --desc ==> Casks not-tetris: (Not Tetris) [no description] tetrio: (TETR.IO) Free-to-play Tetris clone
More doc at: https://docs.brew.sh/Manpage#search
- trust_tap(package_id)[source]ΒΆ
Trust the tap a third-party
package_idbelongs to.Homebrew 6.0.0 rejects code from third-party taps until the tap (or each formula or cask) has been explicitly trusted. Vanilla
brew installwould otherwise abort with atap trust is requiredwarning when the snapshot pins auser/tap/namepackage.Only fully-qualified package IDs (
user/tap/name) need this step: core formulae and casks live on the trustedhomebrew/coreandhomebrew/casktaps. The tap itself is registered first (idempotent if already tapped) sobrew trustcan resolve the formula or cask. The--formulaand--caskflag is supplied by the subclassβspost_args.$ brew tap gromgit/fuse $ brew trust gromgit/fuse/ntfs-3g-mac --formula
- Return type:
- install(package_id, version=None)[source]ΒΆ
Install one package.
Tap-qualified IDs (
user/tap/name) are routed throughtrust_tap()first so the install isnβt rejected by Homebrew 6.0.0βs tap-trust gate.$ brew install jpeginfo --formula ==> Downloading https://ghcr.io/core/jpeginfo/manifests/1.6.1_1-1 ############################################################## 100.0% ==> Downloading https://ghcr.io/core/jpeginfo/blobs/sha256:27bb35884368b83 ==> Downloading from https://pkg.githubcontent.com/ghcr1/blobs/sha256:27bb3 ############################################################## 100.0% ==> Pouring jpeginfo--1.6.1_1.big_sure.bottle.1.tar.gz πΊ /usr/local/Cellar/jpeginfo/1.6.1_1: 7 files, 77.6KB
$ brew install pngyu --cask ==> Downloading https://nukesaq.github.io/Pngyu/download/Pngyu_mac_101.zip ################################################################## 100.0% ==> Installing Cask pngyu ==> Moving App 'Pngyu.app' to '/Applications/Pngyu.app' πΊ pngyu was successfully installed!
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
brewandcaskshare the same command, butcaskoverrides this method to append--greedywhen auto-updating packages are included.$ brew upgrade --formula ==> Upgrading 2 outdated packages: node 13.11.0 -> 13.12.0 sdl2 2.0.12 -> 2.0.12_1 ==> Upgrading node 13.11.0 -> 13.12.0 ==> Downloading https://homebrew.bintray.com/bottles/node-13.tar.gz ==> Downloading from https://akamai.bintray.com/fc/fc0bfb42fe23e960 ############################################################ 100.0% ==> Pouring node-13.12.0.catalina.bottle.tar.gz ==> Caveats Bash completion has been installed to: /usr/local/etc/bash_completion.d ==> Summary πΊ /usr/local/Cellar/node/13.12.0: 4,660 files, 60.3MB Removing: /usr/local/Cellar/node/13.11.0... (4,686 files, 60.4MB) ==> Upgrading sdl2 2.0.12 -> 2.0.12_1 ==> Downloading https://homebrew.bintray.com/bottles/sdl2-2.tar.gz ==> Downloading from https://akamai.bintray.com/4d/4dcd635465d16372 ############################################################ 100.0% ==> Pouring sdl2-2.0.12_1.catalina.bottle.tar.gz πΊ /usr/local/Cellar/sdl2/2.0.12_1: 89 files, 4.7MB Removing: /usr/local/Cellar/sdl2/2.0.12... (89 files, 4.7MB) ==> Checking for dependents of upgraded formulae... ==> No dependents found! ==> Caveats ==> node Bash completion has been installed to: /usr/local/etc/bash_completion.d
$ brew upgrade --cask ==> Casks with `auto_updates` or `version :latest` will not be upgraded ==> Upgrading 1 outdated packages: aerial 2.0.7 -> 2.0.8 ==> Upgrading aerial ==> Downloading https://github.com/Aerial/download/v2.0.8/Aerial.saver.zip ==> Downloading from https://65be.s3.amazonaws.com/44998092/29eb1e0 ==> Verifying SHA-256 checksum for Cask 'aerial'. ==> Backing Screen Saver up to '/usr/local/Caskroom/Aerial.saver'. ==> Removing Screen Saver '/Users/kde/Library/Screen Savers/Aerial.saver'. ==> Moving Screen Saver to '/Users/kde/Library/Screen Savers/Aerial.saver'. ==> Purging files for version 2.0.7 of Cask aerial πΊ aerial was successfully upgraded!
--yesskips the interactive confirmation prompt thatbrewshows by default since ask mode became the default behaviour.
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
brewandcaskshare the same command.$ brew upgrade dupeguru --cask ==> Upgrading 1 outdated package: dupeguru 4.2.0 -> 4.2.1 ==> Upgrading dupeguru ==> Downloading https://github.com/(...)/4.2.1/dupeguru_macOS_Qt_4.2.1.zip ==> Downloading from https://githubusercontent.com/production-release-asset ##################################################################### 100.0% ==> Backing App 'dupeguru.app' up to '/opt/homebrew/.../4.2.0/dupeguru.app' ==> Removing App '/Applications/dupeguru.app' ==> Moving App 'dupeguru.app' to '/Applications/dupeguru.app' ==> Purging files for version 4.2.0 of Cask dupeguru πΊ dupeguru was successfully upgraded!
--yesskips the interactive confirmation prompt thatbrewshows by default since ask mode became the default behaviour.
- remove(package_id)[source]ΒΆ
Removes a package.
$ brew uninstall bat Uninstalling /usr/local/Cellar/bat/0.21.0... (14 files, 5MB)
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
Scrub the cache, including latest versionβs downloads. Also remove unused dependencies.
Downloads for all installed formulae and casks will not be deleted.
$ brew cleanup -s --prune=all Removing: ~/Library/Caches/Homebrew/node--1.bottle.tar.gz... (9MB) Warning: Skipping sdl2: most recent version 2.0.12_1 not installed Removing: ~/Library/Caches/Homebrew/Cask/aerial--1.8.1.zip... (5MB) Removing: ~/Library/Caches/Homebrew/Cask/prey--1.9.pkg... (19.9MB) Removing: ~/Library/Logs/Homebrew/readline... (64B) Removing: ~/Library/Logs/Homebrew/libfido2... (64B) Removing: ~/Library/Logs/Homebrew/libcbor... (64B)
More doc at: https://docs.brew.sh/Manpage#cleanup
$ brew autoremove ==> Uninstalling 17 unneeded formulae: gtkmm3 highlight lua@5.1 nasm nghttp2 texi2html Uninstalling /usr/local/Cellar/nghttp2/1.41.0_1... (26 files, 2.7MB) Uninstalling /usr/local/Cellar/highlight/3.59... (558 files, 3.5MB) Warning: The following highlight configuration files have not been removed! If desired, remove them manually with `rm -rf`: /usr/local/etc/highlight /usr/local/etc/highlight/filetypes.conf /usr/local/etc/highlight/filetypes.conf.default Uninstalling /usr/local/Cellar/gtkmm3/3.24.2_1... (1,903 files, 173.7MB) Uninstalling /usr/local/Cellar/texi2html/5.0... (279 files, 6.2MB) Uninstalling /usr/local/Cellar/lua@5.1/5.1.5_8... (22 files, 245.6KB) Uninstalling /usr/local/Cellar/nasm/2.15.05... (29 files, 2.9MB)
- Return type:
- cli_names: tuple[str, ...] = ('homebrew',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- class meta_package_manager.managers.homebrew.Brew[source]ΒΆ
Bases:
HomebrewThe formula half of Homebrew: command-line tools built from recipes.
Homebrew is the umbrella project behind the
brewCLI. mpm splits it into two managers over the same binary, this one for formulae andCaskfor macOS applications; a forced--formulaselector keeps every call on the formula side. Homebrew core runs on macOS and on Linux and WSL.mpm drives
brewnon-interactively and pins its environment: analytics and setup hints are silenced, andHOMEBREW_NO_AUTO_UPDATEkeepsbrewfrom folding a metadata refresh into every command, since mpm runs that as a separatesync(asked for since mpmβs early days). Outdated packages come from--json=v2; the installed and search listings are parsed from their plain-text columns.Note
The
>=6.0.0requirement is the release where ask mode became the default forbrew installandbrew upgrade, and where the--yesopt-out mpm relies on for unattended runs first shipped. It is also where Homebrew began rejecting third-party taps until trusted, so installing a fully-qualifieduser/tap/namepackage taps and trusts it first (seeHomebrew.trust_tap()).Caution
A pinned formula still appears in
mpm outdatedoutput, yetbrew upgradesilently skips it: mpm discards Homebrewβspinnedfields today.Initialize
cli_errorslist.- name: str = 'Homebrew Formulae'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://brew.sh'ΒΆ
Home page of the project, only used in documentation for reference.
- brewfile_entry_type: ClassVar[str | None] = 'brew'ΒΆ
Name of the Brewfile DSL entry type this manager maps to, or
Noneif the manager has no Brewfile equivalent.Set by the subset of managers covered by Homebrew Bundleβs DSL (
brew,cask,mas,vscode,npm,cargo,uv,winget,flatpak). Consumed bymeta_package_manager.brewfilewhen rendering the output ofmpm dump --brewfile.
- cli_names: tuple[str, ...] = ('brew',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- post_args: tuple[str, ...] = ('--formula',)ΒΆ
Global list of options used before and after the invoked package manager CLI.
Automatically added to each
meta_package_manager.manager.PackageManager.run_cli()call.Essentially used to force silencing, low verbosity or no-color output.
- class meta_package_manager.managers.homebrew.Cask[source]ΒΆ
Bases:
HomebrewThe cask half of Homebrew: pre-built macOS applications.
Homebrew is the umbrella project behind the
brewCLI. mpm splits it into two managers over the same binary, this one for casks andBrewfor formulae; a forced--caskselector keeps every call on the cask side. Casks ship macOS.appbundles and.pkginstallers, so this manager is macOS-only.mpm drives
brewnon-interactively with the same environment pins asBrew(analytics and hints off,HOMEBREW_NO_AUTO_UPDATEso the metadata refresh stays a separatesync) and the same>=6.0.0floor (ask mode default, the--yesopt-out, and the tap-trust gate thatHomebrew.trust_tap()clears foruser/tap/namepackages).Note
Casks self-escalate: their artifacts (
.pkginstallers, kernel extensions) invokesudofrom insidebrew, so mpm never wraps a cask command in its ownsudo.Caution
Casks flagged
auto_updates trueorversion :latestupdate themselves, andbrew upgradeskips them unless--greedyis passed. mpm supplies--greedy(tooutdatedand toupgrade --all) unless auto-updating packages are being ignored.--greedyconflicts with--formula, so this handling is cask-only and cannot fold into the base shared withBrew.Initialize
cli_errorslist.- name: str = 'Homebrew Cask'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/Homebrew/homebrew-cask'ΒΆ
Home page of the project, only used in documentation for reference.
- brewfile_entry_type: ClassVar[str | None] = 'cask'ΒΆ
Name of the Brewfile DSL entry type this manager maps to, or
Noneif the manager has no Brewfile equivalent.Set by the subset of managers covered by Homebrew Bundleβs DSL (
brew,cask,mas,vscode,npm,cargo,uv,winget,flatpak). Consumed bymeta_package_manager.brewfilewhen rendering the output ofmpm dump --brewfile.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='macos', name='macOS')})ΒΆ
Casks are only available on macOS, not Linux or WSL.
- id: str = 'cask'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- internal_sudo: bool = TrueΒΆ
Cask artifacts (
.pkginstallers, kernel extensions) runsudofrom insidebrew.
- cli_names: tuple[str, ...] = ('brew',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- post_args: tuple[str, ...] = ('--cask',)ΒΆ
Global list of options used before and after the invoked package manager CLI.
Automatically added to each
meta_package_manager.manager.PackageManager.run_cli()call.Essentially used to force silencing, low verbosity or no-color output.
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
Adds
--greedyto the sharedbrew upgradecommand when auto-updating packages are included, mirroringHomebrew.outdated(). Without it,brew upgradeskips casks flaggedauto_updates trueorversion :latest, sompm --include-auto-updates upgrade --allwould report them as outdated but never upgrade them.Note
This override is cask-only by necessity:
brew upgradedeclares--greedyand--formulamutually exclusive, whilebrew outdatedaccepts the pair. The conflict is intentional:--formulahas conflicted with--greedyever since the selector switch was added to brew upgrade in August 2020, and a request to tolerate--greedyas a no-op in formula-only contexts was declined as invalid usage. This method can therefore never fold back into the base class shared withbrew.A cask explicitly passed to
brew upgradeis always evaluated greedily, soHomebrew.upgrade_one_cli()needs no counterpart.
meta_package_manager.managers.mas moduleΒΆ
- class meta_package_manager.managers.mas.MAS[source]ΒΆ
Bases:
PackageManagermasdrives the Mac App Store from the command line.Packages are Mac App Store applications, keyed by the numeric adamID Apple assigns each title (the
idin an App Store link). mpm reads and writes that ID; the display name rides along only as a label.Every query reads
--jsonoutput, the supported programmatic interface since the>=7.0.0floor added--jsontolist,outdatedandsearch. It sidesteps the column-alignment ambiguities of the tabular listing, where an app name carrying parentheses or padding whitespace would derail a positional parser.Note
masprints one JSON object per app, concatenated rather than wrapped in an array, and leaves control characters (embedded newlines,U+2028) unescaped inside name and description strings (upstream bug). mpm decodes the buffer one object at a time withstrict=Falseso each object ends at its own closing brace instead of splitting on those bytes.Note
masself-escalates: it asks for root itself when a store mutation needs it, so mpm never wrapsinstall,upgradeoruninstallin its ownsudo.Initialize
cli_errorslist.- name: str = 'Mac App Store'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/mas-cli/mas'ΒΆ
Home page of the project, only used in documentation for reference.
- brewfile_entry_type: ClassVar[str | None] = 'mas'ΒΆ
Name of the Brewfile DSL entry type this manager maps to, or
Noneif the manager has no Brewfile equivalent.Set by the subset of managers covered by Homebrew Bundleβs DSL (
brew,cask,mas,vscode,npm,cargo,uv,winget,flatpak). Consumed bymeta_package_manager.brewfilewhen rendering the output ofmpm dump --brewfile.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='macos', name='macOS')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=7.0.0'ΒΆ
7.0.0 introduces the
--jsonflag onconfig,list,lookup/info,outdated&search. Parsing structured JSON output is the supported programmatic interface: it sidesteps the column-alignment ambiguities of the tabular output (app names containing parentheses or extra whitespace would break the previous regex-based parser).
- brewfile_entry(package)[source]ΒΆ
Brewfile
masentries take the appβs display name as the positional argument and the Mac App Store numeric ID as theid:keyword.Returns
None(silently skip) for any package whose ID is not a numeric adamID: that shape is impossible to round-trip throughbrew bundlewithout the ID, and a half-brokenmas "Name"line would error at install time.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ mas list --json {"adamID":1569813296,"bundleID":"com.1password.1password-safari","name":"1Password for Safari","version":"2.3.5"} {"adamID":1295203466,"bundleID":"com.microsoft.rdc.macos","name":"Microsoft Remote Desktop","version":"10.7.6"} {"adamID":409183694,"bundleID":"com.apple.iWork.Keynote","name":"Keynote","version":"12.0"}
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ mas outdated --json {"adamID":409183694,"name":"Keynote","newVersion":"12.0","version":"11.0"} {"adamID":1176895641,"name":"Spark","newVersion":"2.11.21","version":"2.11.20"}
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not support extended or exact matching. So we return the best subset of results and let
meta_package_manager.manager.PackageManager.refiltered_search()refine them.$ mas search python --json {"adamID":689176796,"name":"Python Runner","version":"1.3"} {"adamID":630736088,"name":"Learning Python","version":"1.0"} {"adamID":945397020,"name":"Run Python","version":"1.0"} {"adamID":1164498373,"name":"PythonGames","version":"1.0"} {"adamID":1400050251,"name":"Pythonic","version":"1.0.0"}
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ mas install 945397020
- Return type:
- cli_names: tuple[str, ...] = ('mas',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'mas'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ mas upgrade 945397020
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- remove(package_id)[source]ΒΆ
Removes a package.
mas4.1.0+ requests root privileges itself when not already running as root, so we donβt pre-wrap the call insudo. This matches howinstallandupgradeare already invoked.$ mas uninstall 1494051017 Password: Uninstalled '/Applications/SimpleLogin.app' to '/Users/kde/.Trash/SimpleLogin.app'
- Return type:
meta_package_manager.managers.mise moduleΒΆ
- class meta_package_manager.managers.mise.Mise[source]ΒΆ
Bases:
PackageManagermise (formerly rtx) installs and switches between versions of developer tools like Node, Python, Ruby and any tool reachable through its plugin backends.
Note
mpmis system-scoped, so this wrapper reports every tool version present on disk regardless of whichmise.toml(global or project) requested it. Project-pinned versions are not surfaced as a separate scope.Note
Backend-prefixed tool IDs (
pipx:ruff,cargo:ubi-cli,asdf:mise-plugins/mise-poetry) round-trip as-is. The colon is part of the package ID;mpm install pipx:ruffresolves the backend throughmiseitself.Caution
mise outdated --jsononly reports tools tracked in amise.toml(global or project). A tool installed bare withmise install <tool>and never pinned withmise usewill not appear in the outdated list, sompm outdated --miseunderstates the upgrade surface for those entries.Initialize
cli_errorslist.- homepage_url: str | None = 'https://mise.jdx.dev'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=2025.5.10'ΒΆ
mise searchshipped in2025.5.10, the binding floor for the feature set this wrapper depends on. Earlier releases also miss theoutdated --jsonfix from2025.2.8that emits valid JSON when no tool is outdated.
- version_regexes: tuple[str, ...] = ('^(?P<version>\\d+\\.\\d+\\.\\d+)',)ΒΆ
miseuses CalVer (YYYY.M.P), not SemVer.$ mise --version 2026.6.3 macos-arm64 (2026-06-13)
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
Emits one
meta_package_manager.package.Packageper(tool, installed_version)pair, so a tool installed at multiple versions yields multiple entries sharing the same ID.$ mise ls --installed --json { "node": [ { "version": "20.10.0", "install_path": "~/.local/share/mise/installs/node/20.10.0", "source": {"type": "mise.toml", "path": "~/.config/mise/config.toml"} } ], "pipx:ruff": [ { "version": "0.6.9", "install_path": "~/.local/share/mise/installs/pipx-ruff/0.6.9" } ] }
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ mise outdated --json { "node": { "requested": "20", "current": "20.0.0", "latest": "20.10.0" } }
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
mise searchreturns a two-columnTool Descriptiontable.--match-type containskeeps the candidate set wide; the frameworkβsmeta_package_manager.manager.PackageManager.refiltered_search()narrows it down to honorextendedandexactflags.$ mise search --no-header --match-type contains node node Node.js node-build Compile and install Node.js nodejs alias for node
- install(package_id, version=None)[source]ΒΆ
Install one package.
mise install <tool>resolves to the latest version compatible with the active config;mise install <tool>@<version>pins it explicitly. Neither variant writes tomise.toml: the dedicatedmise usecommand is the config-mutating verb and is deliberately avoided here.$ mise install node@20
- Return type:
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade one package.
$ mise upgrade node
- remove(package_id)[source]ΒΆ
Remove one package.
mise uninstall <tool>errors when more than one version of the tool is installed.--allremoves every installed version unconditionally, which matchesmpmβs βremove this packageβ contract.$ mise uninstall --all node
- Return type:
- cli_names: tuple[str, ...] = ('mise',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'mise'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- sync()[source]ΒΆ
Refresh plugin metadata.
miseresolves tool listings and version catalogues through its plugins, so updating the plugins is the closest equivalent to the package-list refresh other managers perform during sync.$ mise plugins update
- Return type:
meta_package_manager.managers.nix moduleΒΆ
- class meta_package_manager.managers.nix.Nix[source]ΒΆ
Bases:
PackageManagerNix, the functional package manager.
Note
All operations use the imperative
nix-envinterface, which manages a per-user package profile. Declarative approaches (NixOS modules, home-manager) are not covered.Channel refresh (
sync) and store garbage collection (cleanup) shell out to the siblingnix-channelandnix-collect-garbagebinaries installed alongsidenix-env, not tonix-envitself.Initialize
cli_errorslist.- homepage_url: str | None = 'https://nixos.org'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=2.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- cli_names: tuple[str, ...] = ('nix-env',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- version_regexes: tuple[str, ...] = ('nix-env \\(Nix\\) (?P<version>\\S+)',)ΒΆ
$ nix-env --version nix-env (Nix) 2.18.1
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ nix-env --query --installed hello-2.12.1 nix-2.18.1 python3-3.11.6
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ nix-env --query --upgradeable --compare-versions hello-2.12.1 < 2.13.0 python3-3.11.6 < 3.12.0
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not support extended or exact matching. So we return the best subset of results and let
meta_package_manager.manager.PackageManager.refiltered_search()refine them.Caution
nix-env --query --availableevaluates the full nixpkgs set and can be slow on first invocation.$ nix-env --query --available --attr-path --description 'hello' nixpkgs.hello hello-2.12.1 A program that produces a friendly greeting
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ nix-env --install hello
- Return type:
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade one package.
$ nix-env --upgrade hello
- cleanup()[source]ΒΆ
Remove old generations and garbage-collect the Nix store.
$ nix-collect-garbage --delete-old
- Return type:
meta_package_manager.managers.npm moduleΒΆ
- class meta_package_manager.managers.npm.NPM[source]ΒΆ
Bases:
PackageManagerThe Node.js package manager.
mpm drives npm in global mode: every call forces
--globalso packages land in the shared prefix instead of the current working directory. Per-scope targeting and multi-binary discovery (several node versions through nvm) are tracked in #1725. Command equivalences with the sibling JS managers are listed at https://github.com/antfu-collective/ni?tab=readme-ov-file#ni.Queries parse npmβs
--jsonoutput. Mutating operations are marked privileged so--sudocan escalate writes into a root-owned global prefix, though escalation stays dormant unless requested.Note
npm enforces a supply-chain cooldown through its
min-release-ageresolver option, refusing to resolve any release younger than the configured age. The version floor exists for it:min-release-agefirst shipped in11.10.0, and older releases silently ignore the setting.Caution
A fatal npm error (usually a local node version out of sync) is reported both on
<stderr>and as a JSON blob on<stdout>. Therun_clioverride blanks that JSON so the failure surfaces once, through<stderr>, rather than being parsed as a package listing.Initialize
cli_errorslist.- name: str = 'Node npm'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://www.npmjs.com'ΒΆ
Home page of the project, only used in documentation for reference.
- brewfile_entry_type: ClassVar[str | None] = 'npm'ΒΆ
Name of the Brewfile DSL entry type this manager maps to, or
Noneif the manager has no Brewfile equivalent.Set by the subset of managers covered by Homebrew Bundleβs DSL (
brew,cask,mas,vscode,npm,cargo,uv,winget,flatpak). Consumed bymeta_package_manager.brewfilewhen rendering the output ofmpm dump --brewfile.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=11.10.0'ΒΆ
11.10.0 is the first version to ship
min-release-age, the purpose-built release-age gate mpm uses for the supply-chain cooldown (seecooldown_env_var). Older npm releases silently ignore the env var, so the floor avoids advertising a gate that does nothing.
- cooldown_env_var: ClassVar[str | None] = 'npm_config_min-release-age'ΒΆ
npm honors a release-age cooldown through its
min-release-ageresolver option.npm maps any
npm_config_<key>environment variable to a config setting, sonpm_config_min-release-agesetsmin-release-agewithout touching the userβs.npmrc. Once set, npm refuses to resolve any package version younger than the configured age, which coversinstallandupdatealong with their transitive dependencies. The hyphenated env var passes cleanly through Pythonβssubprocess.Popenenv=mapping (shells that rejectexport foo-bar=bazare not involved).The
cooldown_env_value()method below is overridden to emit an integer number of days, the unitmin-release-ageexpects.See https://docs.npmjs.com/cli/v11/using-npm/config#min-release-age.
- pre_args: tuple[str, ...] = ('--global', '--no-progress', '--no-update-notifier', '--no-fund', '--no-audit')ΒΆ
$ npm --version 6.13.7
- cooldown_env_value()[source]ΒΆ
Render
meta_package_manager.execution.CLIExecutor.cooldownas an integer day count for npmβsmin-release-age.Sub-day cooldowns round up so the gate over-protects rather than silently collapses to
0(the βno cooldownβ sentinel).- Return type:
- run_cli(*args, **kwargs)[source]ΒΆ
Like the common run_cli helper, but silence NPMβs JSON output on error.
NPM is prone to breakage if local node version is not in sync:
$ npm --global --no-progress --no-update-notifier --no-fund --no-audit --json outdated { "error": { "code": "ERR_OUT_OF_RANGE", "summary": "The value of "err" is out of range. Received 536870212", "detail": "" } }
- Return type:
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ npm --global --no-progress --no-update-notifier --no-fund --no-audit --json --depth 0 list { "name": "lib", "dependencies": { "@eslint/json": { "version": "0.9.0", "overridden": false }, "@mermaid-js/mermaid-cli": { "version": "10.8.0", "overridden": false }, "corepack": { "version": "0.30.0", "overridden": false }, "google-closure-compiler": { "version": "20240317.0.0", "overridden": false }, "npm": { "version": "10.9.2", "overridden": false }, "raven": { "version": "2.6.4", "overridden": false }, "wrangler": { "version": "3.51.2", "overridden": false } } }
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ npm --global --no-progress --no-update-notifier --no-fund --no-audit --json outdated { "my-linked-package": { "current": "0.0.0-development", "wanted": "linked", "latest": "linked", "location": "/Users/kev/dev/my-linked-package" }, "npm": { "current": "3.10.3", "wanted": "3.10.5", "latest": "3.10.5", "location": "/opt/homebrew/lib/node_modules/npm" } }
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Doc: https://docs.npmjs.com/cli/search.html
Caution
Search does not supports exact matching.
$ npm --global --no-progress --no-update-notifier --no-fund --no-audit search --json python | jq [ { "name": "python", "description": "Interact with a python child process", "maintainers": [ { "username": "drderidder", "email": "drderidder@gmail.com" } ], "version": "0.0.4", "date": "2015-01-25T02:48:07.820Z" }, { "name": "raven", "description": "A standalone (Node.js) client for Sentry", "maintainers": [ { "username": "benvinegar", "email": "ben@benv.ca" }, { "username": "lewisjellis", "email": "me@lewisjellis.com" }, { "username": "mattrobenolt", "email": "m@robenolt.com" }, { "username": "zeeg", "email": "dcramer@gmail.com" } ], "keywords": [ "raven", "sentry", "python", "errors", "debugging", "exceptions" ], "version": "1.1.2", "date": "2017-02-09T02:54:07.723Z" }, { "name": "brush-python", "description": "Python brush module for SyntaxHighlighter.", "maintainers": [ { "username": "alexgorbatchev", "email": "alex.gorbatchev@gmail.com" } ], "keywords": [ "syntaxhighlighter", "brush", "python" ], "version": "4.0.0", "date": "2016-02-07T21:32:39.597Z" }, (...) ]
$ npm --global --no-progress --no-update-notifier --no-fund --no-audit search --json --no-description python | jq
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ npm --global --no-progress --no-update-notifier --no-fund --no-audit install markdown added 3 packages in 3s
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ npm --global --no-progress --no-update-notifier --no-fund --no-audit update
- cli_names: tuple[str, ...] = ('npm',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'npm'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the package provided as parameter.
$ npm --global --no-progress --no-update-notifier --no-fund --no-audit upgrade raven
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
meta_package_manager.managers.pacman moduleΒΆ
- class meta_package_manager.managers.pacman.Pacman[source]ΒΆ
Bases:
PackageManagerArch Linuxβs native package manager, covering the official repositories.
mpmforces--noconfirmand--color neveron every call so pacman runs unattended and prints uncolored text the regexes can parse. Installed packages come from--queryand upgradable ones from--query --upgrades; searches hit the sync databases via--sync --search.The
Pacaur,ParuandYaysubclasses are AUR helpers that reuse every parser and forced argument here unchanged, overriding only the binary (and, foryay, adding a release-age cooldown).See command equivalences at: https://wiki.archlinux.org/title/Pacman/Rosetta.
Caution
--query --upgradesonly reports updates for packages tracked in a sync database, so foreign packages (installed withpacman -U, as AUR helpers do) stay invisible to the basepacmanbinary. The subclasses escape this because their own binary also queries the AUR RPC. This upstream behavior is not confirmed on a live Arch box: seePacman.outdated().Initialize
cli_errorslist.- name: str = 'Arch Linux pacman'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://wiki.archlinux.org/title/pacman'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- requirement: str | None = '>=5.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- version_regexes: tuple[str, ...] = ('.*Pacman\\s+v(?P<version>\\S+)',)ΒΆ
Search version right after the ``Pacman `` string.
$ pacman --version .--. Pacman v6.0.1 - libalpm v13.0.1 / _.-' .-. .-. .-. Copyright (C) 2006-2021 Pacman Development Team \ '-. '-' '-' '-' Copyright (C) 2002-2006 Judd Vinet '--' This program may be freely redistributed under the terms of the GNU General Public License.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ pacman --noconfirm --query a52dec 0.7.4-11 aalib 1.4rc5-14 abseil-cpp 20211102.0-2 accountsservice 22.08.8-2 acl 2.3.1-2 acme.sh 3.0.2-1 acpi 1.7-3 acpid 2.0.33-1
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ pacman --noconfirm --query --upgrades linux 4.19.1.arch1-1 -> 4.19.2.arch1-1 linux-headers 4.19.1.arch1-1 -> 4.19.2.arch1-1
Note
pacman --query --upgrades(-Qu) only reports updates for packages tracked in a sync database (official repos, plus any local repo configured inpacman.conf). Foreign packages, those installed withpacman -Uas most AUR helpers do, are invisible to-Quand surface only under-Qm.The
Pacaur,ParuandYaysubclasses inherit this method verbatim, yet still see AUR updates because their own binaryβs-Quadditionally queries the AUR RPC for foreign packages. The per-subclass binary override is therefore load-bearing: routing these helpers throughpacmandirectly would silently drop every AUR update from the results.Caution
This follows upstream
-Qusemantics but has not been confirmed on a live Arch box. Before relying on it, verify thatyay --query --upgradesinvoked through mpm actually surfaces a pending AUR update.
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not supports extended matching.
$ pacman --noconfirm --sync --search fire extra/dump_syms 0.0.7-1 Symbol dumper for Firefox extra/firefox 99.0-1 Standalone web browser from mozilla.org extra/firefox-i18n-ach 99.0-1 Acholi language pack for Firefox extra/firefox-i18n-af 99.0-1 Afrikaans language pack for Firefox extra/firefox-i18n-an 99.0-1 Aragonese language pack for Firefox extra/firefox-i18n-ar 99.0-1 Arabic language pack for Firefox extra/firefox-i18n-ast 99.0-1 Asturian language pack for Firefox
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ sudo pacman --noconfirm --color never --sync firefox
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade the package provided as parameter.
$ sudo pacman --noconfirm --color never --sync --refresh --sysupgrade
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the package provided as parameter.
$ sudo pacman --noconfirm --color never --sync firefox
- remove(package_id)[source]ΒΆ
Removes a package.
$ sudo pacman --noconfirm --color never --remove firefox
- Return type:
- sync()[source]ΒΆ
Sync package metadata.
$ pacman --noconfirm --color never --sync --refresh
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
$ sudo pacman --noconfirm --color never --sync --clean --clean
- Return type:
- cli_names: tuple[str, ...] = ('pacman',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- class meta_package_manager.managers.pacman.Pacaur[source]ΒΆ
Bases:
PacmanAUR helper wrapping
pacman, driven through thepacaurbinary.Inherits every operation, parser and forced argument from
Pacman; only the binary and version probe differ. Routing throughpacauris what lets--query --upgradesreport AUR updates on top of the official repositories.Unlike
pacman, the helper must run as the regular user: it aborts under root (you cannot perform this operation as root) becausemakepkgrefuses to build as root, and it invokessudo pacmanitself for the privileged steps.mpmtherefore never wraps it insudo.Initialize
cli_errorslist.- name: str = 'Arch Linux pacaur'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/E5ten/pacaur'ΒΆ
Home page of the project, only used in documentation for reference.
- default_sudo: bool = FalseΒΆ
pacaur aborts its sync-class operations under root and runs
sudo pacmanitself, so the escalation default inherited fromPacmanmust not wrap it.
- internal_sudo: bool = TrueΒΆ
pacaur calls
sudo pacmanfrom inside its own commands for the install, upgrade and removal steps.
- requirement: str | None = '>=4.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- version_regexes: tuple[str, ...] = ('pacaur\\s+(?P<version>\\S+)',)ΒΆ
Search version right after the
pacaurstring.$ pacaur --version pacaur 4.8.6
- cli_names: tuple[str, ...] = ('pacaur',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- class meta_package_manager.managers.pacman.Paru[source]ΒΆ
Bases:
PacmanAUR helper wrapping
pacman, driven through theparubinary.Inherits every operation, parser and forced argument from
Pacman; only the binary and version probe differ. Its own--query --upgradesreports AUR updates on top of the official repositories. The>=1.9.3floor is the firstparurelease to implement--sysupgrade, the flag the inheritedupgrade_all_clibuilds.Unlike
pacman, the helper must run as the regular user: any transaction building AUR packages aborts under root (can't install AUR package as root), and paru invokessudo pacmanitself for the privileged steps.mpmtherefore never wraps it insudo.Initialize
cli_errorslist.- name: str = 'Arch Linux paru'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/Morganamilo/paru'ΒΆ
Home page of the project, only used in documentation for reference.
- default_sudo: bool = FalseΒΆ
paru refuses to build AUR packages under root and runs
sudo pacmanitself, so the escalation default inherited fromPacmanmust not wrap it.
- internal_sudo: bool = TrueΒΆ
paru calls
sudofrom inside its own commands (theSudo/SudoFlagssettings ofparu.conf) for the install, upgrade and removal steps.
- requirement: str | None = '>=1.9.3'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- version_regexes: tuple[str, ...] = ('paru\\s+v(?P<version>\\S+)',)ΒΆ
Search version right after the
parustring.$ paru --version paru v1.10.0 - libalpm v13.0.1
- cli_names: tuple[str, ...] = ('paru',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- class meta_package_manager.managers.pacman.Yay[source]ΒΆ
Bases:
PacmanAUR helper wrapping
pacman, driven through theyaybinary.Inherits every operation, parser and forced argument from
Pacman; the binary, version probe and the release-age cooldown below are what differ. Its own--query --upgradesreports AUR updates on top of the official repositories.Unlike
pacman, the helper must run as the regular user: yay warns under root (Avoid running yay as root/sudo.) and any AUR build then dies inmakepkg, which refuses to run as root. yay drivessudoitself for the privileged steps (its--sudo,--sudoflagsand--sudoloopoptions), sompmnever wraps it insudo. That also keeps the injectedXDG_CONFIG_HOMEcooldown overlay below visible to yay, where asudowrap would have reset the environment.Note
yay exposes no release-age flag, so mpm enforces the supply-chain
cooldownby overlaying a generatedinit.luathrough a privateXDG_CONFIG_HOME(seeYay.cooldown_env()). This needs yay >= 13.0.0, when the LuaUpgradeSelect/AURPreInstallhooks landed; an older yay stays a usable manager but cannot honor a cooldown. The upstream request for a less invasive injection point is https://github.com/Jguer/yay/issues/2883.Initialize
cli_errorslist.- name: str = 'Arch Linux yay'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/Jguer/yay'ΒΆ
Home page of the project, only used in documentation for reference.
- default_sudo: bool = FalseΒΆ
yay discourages root runs (
makepkghard-refuses them for AUR builds) and drivessudoitself, so the escalation default inherited fromPacmanmust not wrap it. A wrap would also strip theXDG_CONFIG_HOMEcooldown overlay throughsudoβs environment reset.
- cli_names: tuple[str, ...] = ('yay',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'yay'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- internal_sudo: bool = TrueΒΆ
yay calls the escalation binary from inside its own commands, configurable through its
--sudo,--sudoflagsand--sudoloopoptions.
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- requirement: str | None = '>=11.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- cooldown_env_var: ClassVar[str | None] = 'XDG_CONFIG_HOME'ΒΆ
yay reads no release-age option of its own, so mpm repurposes
XDG_CONFIG_HOMEto point yay at the throwaway config overlay built bycooldown_env().Unlike the single-value variables of pip/uv/npm, the value is a directory; the cutoff itself rides alongside it in
MPM_COOLDOWN_EPOCH. Set so the structuralsupports_cooldowncheck (and the--cooldownhelp text) still recognize yay as cooldown-capable.
- version_regexes: tuple[str, ...] = ('yay\\s+v(?P<version>\\S+)',)ΒΆ
Search version right after the
yaystring.$ yay --version yay v11.1.2 - libalpm v13.0.1
- cooldown_requirement = '>=13.0.0'ΒΆ
Minimum yay version whose Lua hooks the cooldown overlay relies on.
v13.0.0 introduced
yay.create_autocmdand theUpgradeSelect/AURPreInstallevents. Kept apart fromrequirement(>=11.0.0) so a v11/v12 yay stays fully usable for everything except the cooldown.
- property supports_cooldown: boolΒΆ
Whether this yay can natively enforce a release-age cooldown.
Reports the structural capability while idle (
cooldown is None) so the import-timeCOOLDOWN_SUPPORTED_MANAGERShelp text stays I/O-free, and only probes the managerversiononce a cooldown is active, gating oncooldown_requirement. A yay older than that (or undetectable) reports no support, so the fail-closed default skips install/upgrade rather than running them unguarded.
- cooldown_env()[source]ΒΆ
Deliver the release-age cooldown through a private
XDG_CONFIG_HOME.yay has no release-age option, so rather than injecting a single value mpm points yay at
_cooldown_overlay_dir: a throwaway config tree whose generatedinit.lua(_YAY_COOLDOWN_INIT_LUA) registers the cooldown Lua hooks. The cutoff travels asMPM_COOLDOWN_EPOCH(Unix seconds ofnow - cooldown), keeping theinit.luaasset static, andMPM_YAY_USER_DIRlets it chain the userβs real config so the redirect stays lossless.Returns an empty mapping when no cooldown is set or the installed yay predates the Lua hooks (see
supports_cooldown).
meta_package_manager.managers.pacstall moduleΒΆ
- class meta_package_manager.managers.pacstall.Pacstall[source]ΒΆ
Bases:
PackageManagerAUR-inspired, source-based package manager for Ubuntu and other Linux distributions.
Pacstall builds packages from βpacscriptsβ and installs the results as
.debarchives throughdpkg.mpmforcesNO_COLORandDISABLE_PROMPTSso output is uncolored and every call stays non-interactive.Note
Listing installed packages is a two-step probe: piped
--listprints bare names with no versions, sompmfollows each with a--cache-info <pkg> versioncall to recover its version.Note
--searchmatches names only and reports no versions. There is no per-package upgrade verb either, so upgrading one package reinstalls it through--install.Initialize
cli_errorslist.- homepage_url: str | None = 'https://pacstall.dev'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=6.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- extra_env: ClassVar = {'DISABLE_PROMPTS': '1', 'NO_COLOR': '1'}ΒΆ
Suppress ANSI colors and disable interactive prompts.
- version_regexes: tuple[str, ...] = ('(?P<version>\\d+\\.\\d+\\.\\d+)',)ΒΆ
$ pacstall --version 6.3.7 Vanilla
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ pacstall --list neofetch neovim
Note
When piped,
pacstall --listoutputs bare package names without versions. A follow-uppacstall --cache-info <pkg> versioncall retrieves the installed version per package.
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ pacstall --list-upgrades Upgradable: 2 neofetch @ pacstall-programs#master ( 7.1.0-2 -> 7.2.0-1 ) neovim @ pacstall-programs#master ( 0.9.4-1 -> 0.10.0-1 )
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not support extended or exact matching, and does not provide version information. Returns the best subset of results and lets
meta_package_manager.manager.PackageManager.refiltered_search()refine them.$ pacstall --search neovim neovim @ pacstall-programs neovim-git @ pacstall-programs
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ pacstall --install neofetch
- Return type:
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade one package by reinstalling it.
$ pacstall --install neofetch
- cli_names: tuple[str, ...] = ('pacstall',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'pacstall'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- name: str = 'Pacstall'ΒΆ
Return package managerβs common name.
Default value is based on class name.
meta_package_manager.managers.pip moduleΒΆ
- class meta_package_manager.managers.pip.Pip[source]ΒΆ
Bases:
PackageManagerThe pip package installer for Python, driven as a module (
python -m pip) rather than through thepipexecutable.Calling the module through the interpreter lets
pipupgrade itself, an advantage on Windows in particular (https://snarky.ca/why-you-should-use-python-m-pip/).Installed and outdated packages are read from pipβs
list --format=jsonoutput. Theoutdatedquery adds--not-requiredto report only top-level packages, since upgrading a transitive dependency can break its parentβs version constraints (#1214). There is nosearch: PyPI disabled its server-side search API in 2020 under unmanageable load, sopip searchno longer works (see pip issue 5216).Note
All operations target the default pip scope (system site-packages, or the active virtualenv). Per-scope targeting (system vs user vs venv) and multi-binary discovery (multiple pythons via pyenv) are tracked in #1725.
Note
Interpreter discovery probes the running Python first, so an
mpminstalled inside a virtualenv manages that virtualenv, then the Python(s) onPATH. Two kinds are skipped so the manager only targets a scope the user can install into:mpmβs own distributor-managed bundle (Homebrew stages it under aCellarprefix) and any externally-managed, non-virtualenv interpreter that PEP 668 forbidspip installinto. When every candidate is skipped, the manager reports as unavailable.Note
Installs, upgrades and removals are marked privileged, so a global install can escalate with
--sudo, but escalation is off by default. The supply-chain cooldown needs pip26.1, the first release to honor--uploaded-prior-to; older pip silently ignores the release-age gate.Initialize
cli_errorslist.- name: str = 'Python pip'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://pip.pypa.io'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=26.1.0'ΒΆ
26.1 is the first version to ship
--uploaded-prior-to, the release-age gate mpm uses for the supply-chain cooldown (seecooldown_env_var). Older pip releases silently ignorePIP_UPLOADED_PRIOR_TO, so the floor avoids advertising a gate that does nothing.
- cooldown_env_var: ClassVar[str | None] = 'PIP_UPLOADED_PRIOR_TO'ΒΆ
pip honors a release-age cooldown through its
--uploaded-prior-toresolver option.pip maps any
PIP_<UPPER_SNAKE>environment variable to a config setting, soPIP_UPLOADED_PRIOR_TOsets the option without touching the userβspip.conf. The flag excludes from resolution any distribution uploaded after the given instant, which coversinstallandupgrade(with transitive dependencies). pip parses the RFC 3339 timestamp produced by the defaultmeta_package_manager.execution.CLIExecutor.cooldown_env_value().
- cli_names: tuple[str, ...] = ('python3', 'python')ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- version_cli_options: tuple[str, ...] = ('-m', 'pip', '--no-color', '--version')ΒΆ
CLI options used to produce the version of the package manager.
The raw output produced by the package manager CLI will be parsed with the
version_regexesbelow to extract the version number.
- version_regexes: tuple[str, ...] = ('pip\\s+(?P<version>\\S+)',)ΒΆ
$ python -m pip --no-color --version pip 2.0.2 from /usr/local/lib/python/site-packages/pip (python 3.7)
- search_all_cli(cli_names, env=None)[source]ΒΆ
Yield the Python interpreters the pip manager may target.
The running interpreter is probed first, so an
mpminstalled into a virtualenv manages that virtualenvβs own packages, then the Python(s) found onPATH. Two kinds of interpreter are skipped, so the pip manager only ever targets a scope the user can actually install into:mpmβs own distributor-managed bundle (see
_running_from_bundled_app()), andany externally-managed, non-virtualenv interpreter PEP 668 would forbid
pip installinto (see_pip_install_blocked()).
When every candidate is skipped the manager is left with no
cli_pathand reports as unavailable, which is correct: there is no user-managed pip environment to act on.Todo
Evaluate findpython (the maintained MIT rewrite of
pythonfinder) to replace the discovery loop here. It would only cover discovery: the eligibility filters (_running_from_bundled_app(),_pip_install_blocked()) stay mpmβs job, since findpython locates interpreters but does not judge whetherpip installis allowed into one.
- property version: TokenizedString | NoneΒΆ
Print Pythonβs own version before Pipβs.
This gives much more context to the user about the environment when a Python executable is found but Pip is not.
Runs:
$ python --version --version Python 3.10.10 (Feb 8 2023, 05:34) [Clang 14.0.0 (clang-1400.0.29.202)]
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ python -m pip --no-color list --format=json --verbose --quiet [ { "version": "1.3", "name": "backports.functools-lru-cache", "location": "/usr/local/lib/python3.7/site-packages", "installer": "pip" }, { "version": "0.9999999", "name": "html5lib", "location": "/usr/local/lib/python3.7/site-packages", "installer": "pip" }, { "name": "setuptools", "version": "46.0.0", "location": "/usr/local/lib/python3.7/site-packages", "installer": "" }, { "version": "2.8", "name": "Jinja2", "location": "/usr/local/lib/python3.7/site-packages", "installer": "" } ]
- package_metadata_batch(packages)[source]ΒΆ
Enrich installed pip packages via
importlib.metadata.Each installed distribution exposes its
METADATAfile (theCore Metadatafrom PEP 621) plusRECORD,WHEEL, andINSTALLERfiles in its.dist-infodirectory. This method reads them in-process: no shell-outs, no network, fast enough to enumerate hundreds of distributions in a fraction of a second.Maps
Home-page/Project-URLlines into the portablehomepage/vcs_url/issue_tracker_urlslots, walksRequires-Distinto typedmeta_package_manager.package.Dependencyedges, and promotes the upstream author or maintainer tometa_package_manager.package.Originator.- Return type:
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
Note
The
--not-requiredflag filters out transitive dependencies, restricting results to top-level packages only. Upgrading transitive dependencies can break version constraints of their parent packages. See #1214.$ python -m pip --no-color list --format=json --outdated > --not-required --verbose --quiet [ { "latest_filetype": "wheel", "version": "0.7.9", "name": "alabaster", "latest_version": "0.7.10", "location": "/usr/local/lib/python3.7/site-packages", "installer": "pip" }, { "latest_filetype": "wheel", "version": "0.9999999", "name": "html5lib", "latest_version": "0.999999999", "location": "/usr/local/lib/python3.7/site-packages", "installer": "pip" }, { "latest_filetype": "wheel", "version": "2.8", "name": "Jinja2", "latest_version": "2.9.5", "location": "/usr/local/lib/python3.7/site-packages", "installer": "pip" }, { "latest_filetype": "wheel", "version": "0.5.3", "name": "mccabe", "latest_version": "0.6.1", "location": "/usr/local/lib/python3.7/site-packages", "installer": "pip" }, { "latest_filetype": "wheel", "version": "2.2.0", "name": "pycodestyle", "latest_version": "2.3.1", "location": "/usr/local/lib/python3.7/site-packages", "installer": "pip" }, { "latest_filetype": "wheel", "version": "2.1.3", "name": "Pygments", "latest_version": "2.2.0", "location": "/usr/local/lib/python3.7/site-packages", "installer": "" } ]
- id: str = 'pip'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ python -m pip --no-color install arrow Collecting arrow Using cached arrow-1.1.1-py3-none-any.whl (60 kB) Collecting python-dateutil>=2.7.0 Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB) Requirement already satisfied: six>=1.5 in python3.9/site-packages (1.16.0) Installing collected packages: python-dateutil, arrow Successfully installed arrow-1.1.1 python-dateutil-2.8.2
- Return type:
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the package provided as parameter.
$ python -m pip --no-color install --upgrade six Collecting six Using cached six-1.15.0-py2.py3-none-any.whl (10 kB) Installing collected packages: six Attempting uninstall: six Found existing installation: six 1.14.0 Uninstalling six-1.14.0: Successfully uninstalled six-1.14.0 Successfully installed six-1.15.0
Note
Pip lacks support of a proper full upgrade command. Raising an error let the parent class upgrade packages one by one.
meta_package_manager.managers.pipx moduleΒΆ
- class meta_package_manager.managers.pipx.Pipx[source]ΒΆ
Bases:
PackageManagerpipx installs Python CLI applications, each in its own isolated venv.
Installed applications come from
pipx list --json; only each venvβs main package is tracked, never the packages injected beside it. There is nosearchoperation: the request was closed as not planned, since PyPI exposes no search API and custom search is out of pipxβs scope (see pipx issue 777).Note
The outdated query prefers pipx
1.16.0βs nativepipx list --outdated, which checks every venv in one call, each against its own backend (pip or uv). An older pipx falls back to probing each venv with its embedded pip, one call per application. The version floor stays at1.0.0so an older pipx remains fully usable: only the outdated path degrades.Note
The supply-chain cooldown rides on the underlying pip and needs that pip to be at least
26.1, the first release to honor--uploaded-prior-to; older pip silently ignores the release-age gate.Initialize
cli_errorslist.- name: str = 'Python pipx'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://pipx.pypa.io'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- cooldown_env_var: ClassVar[str | None] = 'PIP_UPLOADED_PRIOR_TO'ΒΆ
pipx defers resolution to pip, so it honors pipβs
--uploaded-prior-togate through the same environment variable.Setting
PIP_UPLOADED_PRIOR_TOon a pipx invocation propagates to the pip subprocess pipx spawns to install the application and its dependencies, so the cutoff applies to the whole resolution. mpm injects the RFC 3339 timestamp from the defaultmeta_package_manager.execution.CLIExecutor.cooldown_env_value().Caution
Same caveat as
meta_package_manager.managers.pip.Pip: the underlying pip must be at least26.1for the gate to take effect. Older pip releases silently ignore the env var.
- outdated_requirement = '>=1.16.0'ΒΆ
Minimum pipx version providing the native outdated query.
1.16.0 introduced
pipx list --outdated(see https://github.com/pypa/pipx/issues/149). Kept apart fromrequirement(>=1.0.0) so an older pipx stays fully usable,outdatedfalling back to one pip probe per venv.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ pipx list --json { "pipx_spec_version": "0.1", "venvs": { "pycowsay": { "metadata": { "injected_packages": {}, "main_package": { "app_paths": [ { "__Path__": "~/.local/pipx/venvs/pycowsay/bin/pycowsay", "__type__": "Path" } ], "app_paths_of_dependencies": {}, "apps": [ "pycowsay" ], "apps_of_dependencies": [], "include_apps": true, "include_dependencies": false, "package": "pycowsay", "package_or_url": "pycowsay", "package_version": "0.0.0.1", "pip_args": [], "suffix": "" }, "pipx_metadata_version": "0.2", "python_version": "Python 3.10.4", "venv_args": [] } } } }
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
pipx
1.16.0introduced a native outdated query, which checks all venvs in a single call, each against its own backend (pip or uv). Injected packages are excluded by default, so only each venvβs main package is reported. Pinned packages are kept: a newer release exists, even ifpipx upgradeskips them.$ pipx list --outdated --output=json { "command": ["list"], "data": { "packages_checked": 1, "packages": [ { "environment": "pycowsay", "package": "pycowsay", "version": "0.0.0.1", "latest_version": "0.0.0.2", "injected": false, "pinned": false } ], "skipped": [] }, "errors": [], "exit_code": 0, "pipx_result_version": "1", "status": "success" }
A pipx older than
outdated_requirementfalls back to probing each venv with its embedded pip, one call per package. Only the venvβs main package is reported; its dependencies also show up inpip list --outdatedbut are silenced:$ pipx runpip pycowsay list --no-color --format=json --outdated > --verbose --quiet [ { "name": "pycowsay", "version": "0.0.0.1", "location": "~/.local/pipx/venvs/pycowsay/lib/python3.10/site-packages", "installer": "pip", "latest_version": "0.0.0.2", "latest_filetype": "wheel" } ]
Todo
Drop the fallback, which mimics
Pip.outdated(), once pipx1.16.0is old enough to be required outright.
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ pipx install pycowsay installed package pycowsay 0.0.0.1, installed using Python 3.10.4 These apps are now globally available - pycowsay done! β¨ π β¨
- Return type:
- cli_names: tuple[str, ...] = ('pipx',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'pipx'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
meta_package_manager.managers.pkcon moduleΒΆ
- class meta_package_manager.managers.pkcon.Pkcon[source]ΒΆ
Bases:
PackageManagerPackageKitβs console client.
Documentation:
pkcon is an unprivileged client handing transactions to the
packagekitddaemon over D-Bus, with the distroβs native backend (apt, dnf, zypp, alpm, β¦) doing the real work. Escalation is polkitβs job, so no operation is markedsudo: under a strict polkit policy, unattended mutations need a policy permitting them without interactive authentication.Note
pkcon renders packages as a fused
name-version.arch (repo)string and never exposes the rawname;version;arch;repoID. Names and versions both legitimately contain dashes, so the name/version split below anchors on the first dash followed by a digit: a documented heuristic, not an exact science.Initialize
cli_errorslist.- name: str = 'PackageKit'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://www.freedesktop.org/software/PackageKit/'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=0.7.0'ΒΆ
All the commands and flags used here (
--plain,--noninteractive,--filter) are present since PackageKit0.7.0.
- extra_env: ClassVar = {'LC_ALL': 'C'}ΒΆ
Additional environment variables to add to the current context.
Automatically applied on each
meta_package_manager.manager.PackageManager.run_cli()calls.
- post_args: tuple[str, ...] = ('--plain',)ΒΆ
Global list of options used before and after the invoked package manager CLI.
Automatically added to each
meta_package_manager.manager.PackageManager.run_cli()call.Essentially used to force silencing, low verbosity or no-color output.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ pkcon get-packages --filter installed --plain Installed gzip-1.12-1.fc38.x86_64 (koji-override-0) Installed hello-2.12.1-2.fc38.x86_64 (fedora)
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
Result lines carry the update type as their status word (
Security,Bug fix,Enhancement,Normal, β¦) and the version of the pending update.Caution
With nothing to update, pkcon prints
There are no updates available at this time.and exits5(PK_EXIT_CODE_NOTHING_USEFUL): a normal empty result, not a failure, so the error recorded for it is discarded.$ pkcon get-updates --plain Security curl-8.0.1-2.fc38.x86_64 (updates) Normal hello-2.12.2-1.fc38.x86_64 (updates)
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
$ pkcon search name hello --plain Available hello-2.12.1-2.fc38.x86_64 (fedora) Installed rubygem-mixlib-shellout-3.2.7-3.fc38.noarch (fedora)
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ pkcon install --noninteractive hello --plain
- Return type:
- cli_names: tuple[str, ...] = ('pkcon',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'pkcon'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all packages.
Note
With nothing to upgrade this exits
5(βnothing useful was doneβ), which the best-effort maintenance flow reports as a failed manager but never as a non-zero mpm exit.$ pkcon update --noninteractive --plain
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade one package.
$ pkcon update --noninteractive hello --plain
meta_package_manager.managers.pkg moduleΒΆ
FreeBSD package managers.
Two managers share this module because they share the FreeBSD ecosystem and the same on-disk install database:
PKGwraps the binarypkgfrontend, which fetches pre-compiled artifacts from the official FreeBSD repository.Portswraps the source-build workflow rooted at/usr/ports, driving make recipes directly and delegating registry queries back topkg.
References:
- meta_package_manager.managers.pkg.PORTS_TREE = PosixPath('/usr/ports')ΒΆ
Canonical location of the FreeBSD ports tree.
The Handbook documents this path as the convention;
PORTSDIRcan override it, but every tool and consumer in the wild assumes this default.
- class meta_package_manager.managers.pkg.PKG[source]ΒΆ
Bases:
PackageManagerFreeBSDβs binary pkg frontend, fetching pre-compiled artifacts from the official FreeBSD repository.
Note
outdatedparsespkg upgrade --dry-runrather thanpkg version, because only the dry-run names the target version each package would move to.Caution
syncforcesIGNORE_OSVERSION=yes: a package built for a newer FreeBSD than the running kernel would otherwise trigger an interactive confirmation that hangs the subprocess. Honoring that variable is also why the version floor is1.11.Initialize
cli_errorslist.- name: str = 'FreeBSD pkg'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/freebsd/pkg'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='freebsd', name='FreeBSD')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=1.11'ΒΆ
1.11 is the first version to support
IGNORE_OSVERSIONenvironment variable.$ pkg --version 1.20.9
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ pkg query "%n %v %c" 7-zip 21.07_2 Console version of the 7-Zip file archiver ap24-mod_mpm_itk 2.4.7_2 Run each vhost under a separate uid and gid apache24 2.4.57 Version 2.4.x of Apache web server aquantia-atlantic-kmod 0.0.5_1 Aquantia AQtion (Atlantic) Network Driver arcconf 3.07.23971,1 Adaptec SCSI/SAS RAID administration tool areca-cli-amd64 1.14.7.150519,1 Command Line Interface for ARC-xxxx RAID base64 1.5_1 Utility to encode and decode base64 files bash 5.1.12 GNU Project's Bourne Again SHell beadm 1.4_1 Solaris-like utility to manage Boot Environments on ZFS
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ pkg upgrade --dry-run Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. Checking for upgrades (312 candidates): 100% Processing candidates (312 candidates): 100% The following 466 package(s) will be affected (of 0 checked): Installed packages to be REMOVED: freenas-files: 13.0_1700495253 py39-midcli: 20190509171453 py39-middlewared: 13.0_1700495253 New packages to be INSTALLED: abseil: 20230125.3 [FreeBSD] argp-standalone: 1.5.0 [FreeBSD] brotli: 1.1.0,1 [FreeBSD] Installed packages to be UPGRADED: 7-zip: 21.07_2 -> 23.01 [FreeBSD] apache24: 2.4.57 -> 2.4.58_1 [FreeBSD] apr: 1.7.0.1.6.1_1 -> 1.7.3.1.6.3_1 [FreeBSD] aquantia-atlantic-kmod: 0.0.5_1 -> 0.0.5_2 [FreeBSD] bash: 5.1.12 -> 5.2.21 [FreeBSD]
Note
We rely on
pkg upgradeinstead ofpkg versionbecause the latter does not provides the new version:$ pkg version --like "<" Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. 7-zip-21.07_2 < apache24-2.4.57 < apr-1.7.0.1.6.1_1 < aquantia-atlantic-kmod-0.0.5_1 < bash-5.1.12 <
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Default search on ID substring:
$ pkg search --raw --raw-format json-compact --search name nginx { "name": "nginx", "version": "1.24.0_14,3", "comment": "Robust and small WWW server", (...) } { "name": "nginx-devel", "version": "1.25.3_9", "comment": "Robust and small WWW server", (...) } { "name": "nginx-ultimate-bad-bot-blocker", "version": "4.2020.03.2005_1", "comment": "Nginx bad bot and other things blocker", (...) } { "name": "p5-Nginx-ReadBody", "version": "0.07_1", "comment": "Nginx embedded perl module to read a request", (...) } (...)
Exact search on ID:
$ pkg search --raw --raw-format json-compact --search name --exact nginx { "name": "nginx", "origin": "www/nginx", "version": "1.24.0_14,3", "comment": "Robust and small WWW server", "maintainer": "joneum@FreeBSD.org", "www": "https://nginx.com/", "abi": "FreeBSD:13:amd64", "arch": "freebsd:13:x86:64", "prefix": "/usr/local", "sum": "c39a7696e6eda7bfedba251e4480e50d4c65c520d5a783a584b19b3ef883", "flatsize": 1464332, "path": "All/nginx-1.24.0_14,3.pkg", "repopath": "All/nginx-1.24.0_14,3.pkg", "licenselogic": "single", "licenses": [ "BSD2CLAUSE" ], "pkgsize": 473632, "desc": "NGINX is a high performance edge web server with the (...)", "deps": { "pcre2": { "origin": "devel/pcre2", "version": "10.42" } }, "categories": [ "www" ], "shlibs_required": [ "libpcre2-8.so.0" ], "options": { "AJP": "off", "ARRAYVAR": "off", "AWS_AUTH": "off", "BROTLI": "off", "CACHE_PURGE": "off", "CLOJURE": "off", "COOKIE_FLAG": "off", "CT": "off", "DEBUG": "off", "DEBUGLOG": "off", "DEVEL_KIT": "off", "DRIZZLE": "off", "DSO": "on", "DYNAMIC_UPSTREAM": "off", "ECHO": "off", "ENCRYPTSESSION": "off", "FILE_AIO": "on", "FIPS_CHECK": "off", "FORMINPUT": "off", "GOOGLE_PERFTOOLS": "off", "GRIDFS": "off", "GSSAPI_HEIMDAL": "off", "GSSAPI_MIT": "off", "HEADERS_MORE": "off", "HTTP": "on", "HTTPV2": "on", "HTTPV3": "off", "HTTPV3_BORING": "off", "HTTPV3_LSSL": "off", "HTTPV3_QTLS": "off", "HTTP_ACCEPT_LANGUAGE": "off", "HTTP_ADDITION": "on", "HTTP_AUTH_DIGEST": "off", "HTTP_AUTH_KRB5": "off", "HTTP_AUTH_LDAP": "off", "HTTP_AUTH_PAM": "off", "HTTP_AUTH_REQ": "on", "HTTP_CACHE": "on", "HTTP_DAV": "on", "HTTP_DAV_EXT": "off", "HTTP_DEGRADATION": "off", "HTTP_EVAL": "off", "HTTP_FANCYINDEX": "off", "HTTP_SUBS_FILTER": "off", "HTTP_TARANTOOL": "off", "HTTP_UPLOAD": "off", "HTTP_UPLOAD_PROGRESS": "off", "HTTP_UPSTREAM_CHECK": "off", "HTTP_UPSTREAM_FAIR": "off", "HTTP_UPSTREAM_STICKY": "off", "HTTP_VIDEO_THUMBEXTRACTOR": "off", "HTTP_XSLT": "off", "HTTP_ZIP": "off", "ICONV": "off", "IPV6": "on", "LET": "off", "LINK": "off", "LUA": "off", "MAIL": "on", "MAIL_IMAP": "off", "MAIL_POP3": "off", "MAIL_SMTP": "off", "MAIL_SSL": "on", "MEMC": "off", "MODSECURITY3": "off", "NAXSI": "off", "NJS": "off", "NJS_XML": "off", "OPENTRACING": "off", "PASSENGER": "off", "POSTGRES": "off", "RDS_CSV": "off", "RDS_JSON": "off", "REDIS2": "off", "RTMP": "off", "SET_MISC": "off", "SFLOW": "off", "SHIBBOLETH": "off", "SLOWFS_CACHE": "off", "SRCACHE": "off", "STREAM": "on", "STREAM_REALIP": "on", "STREAM_SSL": "on", "STREAM_SSL_PREREAD": "on", "STS": "off", "THREADS": "on", "VOD": "off", "VTS": "off", "WEBSOCKIFY": "off", "WWW": "on", "XSS": "off" }, "annotations": { "FreeBSD_version": "1302001", "build_timestamp": "2024-01-07T10:41:34+0000", "built_by": "poudriere-git-3.4.0", "cpe": "cpe:2.3:a:f5:nginx:1.24.0:::::freebsd13:x64:14", "port_checkout_unclean": "no", "port_git_hash": "756e18783", "ports_top_checkout_unclean": "no", "ports_top_git_hash": "756e18783" } }
Extended search:
$ pkg search --raw --raw-format json-compact --search name --search comment --search description nginx
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ pkg --quiet install --yes dmg2img Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. Checking integrity... done (0 conflicting) The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: dmg2img: 1.6.7 [FreeBSD] Number of packages to be installed: 1 [1/1] Installing dmg2img-1.6.7... [1/1] Extracting dmg2img-1.6.7: 100%
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ pkg --quiet upgrade --yes
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ pkg --quiet upgrade --yes dmg2img
- remove(package_id)[source]ΒΆ
Remove one package.
$ pkg --quiet delete --yes dmg2img Checking integrity... done (0 conflicting) Deinstallation has been requested for the following 1 packages: Installed packages to be REMOVED: dmg2img: 1.6.7 Number of packages to be removed: 1 [1/1] Deinstalling dmg2img-1.6.7... [1/1] Deleting files for dmg2img-1.6.7: 100% pkg: Package database is busy while closing!
- Return type:
- sync()[source]ΒΆ
Sync package metadata.
$ IGNORE_OSVERSION=yes pkg --quiet update Updating FreeBSD repository catalogue... Fetching meta.conf: 100% 163 B 0.2kB/s 00:01 Fetching packagesite.pkg: 100% 7 MiB 3.6MB/s 00:02 Processing entries: 100% FreeBSD repository update completed. 33804 packages processed. All repositories are up to date.
The
IGNORE_OSVERSION=yesprevents blocking update:$ pkg --quiet update Updating FreeBSD repository catalogue... Fetching meta.conf: 100% 163 B 0.2kB/s 00:01 Fetching packagesite.pkg: 100% 7 MiB 3.6MB/s 00:02 Processing entries: 0% Newer FreeBSD version for package zziplib: To ignore this error set IGNORE_OSVERSION=yes - package: 1302001 - running kernel: 1301000 Ignore the mismatch and continue? [y/N]:
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
$ pkg --quiet autoremove --yes Checking integrity... done (0 conflicting) Nothing to do.
$ pkg --quiet clean --yes --all Nothing to do.
- Return type:
- cli_names: tuple[str, ...] = ('pkg',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- class meta_package_manager.managers.pkg.Ports[source]ΒΆ
Bases:
PackageManagerFreeBSD ports tree: the source-build workflow rooted at
/usr/ports.Note
Coexists with
PKGon the same system: both share the install database maintained bypkg.Portsbuilds and tracks ports compiled from source under/usr/ports, whilePKGhandles binary packages from the FreeBSD repository. Listing operations may overlap becausepkgdoes not distinguish ports-built from binary-installed packages once they are registered.Note
installedandoutdateddelegate to the siblingpkgbinary, since the ports tree keeps no registry of its own. Builds drive FreeBSDβsmakedirectly withBATCH=yesto accept default build options without prompting. Upgrades shell out to the third-partyportmaster: the ports tree ships no batch upgrader.syncrefreshes the tree withgit(portsnapwas removed after FreeBSD 13).Caution
Mutating operations require root privileges and a populated ports tree at
/usr/ports. The manager flags itself unavailable when the tree is missing.Initialize
cli_errorslist.- name: str = 'FreeBSD Ports Collection'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://www.freebsd.org/ports/'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='freebsd', name='FreeBSD')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- cli_names: tuple[str, ...] = ('make',)ΒΆ
The ports tree is driven by FreeBSDβs make.
No dedicated frontend exists; each port is a directory whose
Makefiletargets are invoked directly.
- extra_env: ClassVar = {'BATCH': 'yes'}ΒΆ
Force non-interactive builds.
Many ports prompt for build option dialogs by default.
BATCH=yesaccepts the saved or default options without user interaction, which is the only sensible behavior for an automated tool. Seeports(7).
- version_cli_options: tuple[str, ...] = ('-V', '.MAKE.VERSION')ΒΆ
FreeBSD
makeexposes its version via internal variable expansion.GNU Makeβs
--versionflag does not work on BSD make; using-V .MAKE.VERSIONkeeps the probe portable and avoids accidentally matching a GNU Make installation shadowing the BSD binary.
- version_regexes: tuple[str, ...] = ('(?P<version>\\d{8,})',)ΒΆ
BSD make reports its version as a date-like integer (e.g.
20240218).
- property available: boolΒΆ
Available only when
makeis found and the ports tree exists.The make binary alone is not enough: without a populated
/usr/portsdirectory, every operation would fail. Treat the tree as part of the managerβs runtime requirement.
- property installed: Iterator[Package]ΒΆ
Fetch packages currently registered as installed.
Delegates to
pkg querybecause the ports tree itself maintains no registry: ports installs are recorded in the same database as binarypkginstalls.$ pkg query "%n %v %o %c" curl 8.7.1 ftp/curl Non-interactive tool to get files from FTP/HTTP servers python311 3.11.9 lang/python311 Interpreted object-oriented programming language
- id: str = 'ports'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- property outdated: Iterator[Package]ΒΆ
Fetch packages whose installed version lags the ports tree.
Uses
pkg versionin ports-comparison mode (-PL=): it walks the local tree for each installed package and reports those with a newerMakefileversion available.$ pkg version -vIPL= curl-8.7.1 < needs updating (port has 8.8.0) python311-3.11.9 < needs updating (port has 3.11.10) vim-9.1.0 = up-to-date with port
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- install(package_id, version=None)[source]ΒΆ
Build and install a port from source.
package_idmay be either a bare port name (e.g.nginx) or its full origin (e.g.www/nginx). When given a bare name, the origin is resolved throughpkg search -oagainst the active repository.$ cd /usr/ports/www/nginx && sudo make BATCH=yes install clean
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generate the CLI to upgrade every outdated port.
The ports tree has no first-party batch upgrader; the workflow relies on the third-party
portmastertool. We build the command line without checking thatportmasteris installed, because upgrade commands are typically printed for the user to inspect before running.$ sudo portmaster --no-confirm --no-term-title -a
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generate the CLI to upgrade one port via
portmaster.$ sudo portmaster --no-confirm --no-term-title www/nginx
- removeΒΆ
Reuses
PKG.remove(): the ports tree has no native uninstaller, and removal goes through the shared install database regardless of how the package was originally built.
- sync()[source]ΒΆ
Refresh the local ports tree from upstream.
Modern FreeBSD distributes the ports tree via Git;
portsnapwas deprecated and removed after FreeBSD 13. We pull from whatever remote the tree was checked out from.$ sudo git -C /usr/ports pull --ff-only
- Return type:
- cleanup()[source]ΒΆ
Remove cached build artifacts from the ports tree.
Walks the tree once and invokes make clean at the root, which recursively cleans every portβs work directory.
DISTCLEAN=yesalso removes downloaded distfiles.$ sudo make -C /usr/ports clean DISTCLEAN=yes BATCH=yes
- Return type:
meta_package_manager.managers.pnpm moduleΒΆ
- class meta_package_manager.managers.pnpm.PNPM[source]ΒΆ
Bases:
PackageManagerA Node.js package manager with a content-addressable global store.
Like
meta_package_manager.managers.npm.NPM, mpm drives pnpm in global mode (--globalon every operation) and parses its--jsonoutput. Command equivalences with the sibling JS managers are listed at https://github.com/antfu-collective/ni?tab=readme-ov-file#ni.Note
pnpm enforces a supply-chain cooldown through its
minimumReleaseAgesetting (counted in minutes), refusing to install any release published more recently than the configured age. The version floor is set bysearch, which first shipped in11.0.0; that release also clears the earlierminimumReleaseAgefloor, so one requirement guards every advertised operation.Caution
pnpm outdatedexits1when it finds outdated packages, printing the report to<stdout>with an empty<stderr>. The query passesmust_succeedso this benign non-zero exit is tolerated instead of raising.Initialize
cli_errorslist.- name: str = 'Node pnpm'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://pnpm.io'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=11.0.0'ΒΆ
11.0.0 is the first version to ship the
searchsubcommand. It also clears the10.16.0floor ofminimumReleaseAge, the release-age gate mpm drives for the supply-chain cooldown (seecooldown_env_var), so a single floor covers every advertised operation. Older pnpm releases either lacksearchor silently ignore the cooldown setting.
- cooldown_env_var: ClassVar[str | None] = 'pnpm_config_minimum_release_age'ΒΆ
pnpm honors a release-age cooldown through its
minimumReleaseAgesetting.pnpm reads any setting from an environment variable built by snake-casing the setting name behind a
pnpm_config_prefix (the docs renderpmOnFailaspnpm_config_pm_on_fail), sopnpm_config_minimum_release_agesetsminimumReleaseAgewithout touchingpnpm-workspace.yaml. Once set, pnpm refuses to install any version published more recently than the configured age, across direct and transitive dependencies.minimumReleaseAgeis expressed in minutes, socooldown_env_value()is overridden to emit a minute count.
- cooldown_env_value()[source]ΒΆ
Render
meta_package_manager.execution.CLIExecutor.cooldownas an integer minute count for pnpmβsminimumReleaseAge.Sub-minute cooldowns round up so the gate over-protects rather than silently collapsing to
0(the βno cooldownβ sentinel).- Return type:
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
pnpm list --jsonreturns an array of project objects; the global scope resolves to a single one whosedependenciesmap holds the installed packages.$ pnpm list --global --json --depth 0 [ { "name": "global", "dependencies": { "eslint": { "from": "eslint", "version": "9.15.0" }, "typescript": { "from": "typescript", "version": "5.6.3" } } } ]
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
pnpm outdatedexits with code1when it finds outdated packages, but writes the report to<stdout>and leaves<stderr>empty. Passingmust_succeedkeeps the lenient failure gate that tolerates a non-zero exit with an empty<stderr>as a benign status code, so the call does not raise (seemeta_package_manager.execution.CLIExecutor.run()).$ pnpm outdated --global --json { "eslint": { "current": "9.10.0", "latest": "9.15.0", "wanted": "9.15.0", "isDeprecated": false, "dependencyType": "dependencies" } }
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
pnpm queries the registryβs
/-/v1/searchendpoint and, with--json, emits an array of the matched packages (an empty[]when none match).Caution
Search does not support exact matching: the registry endpoint matches on names, descriptions and keywords, so the framework refilters the raw results for exact queries.
$ pnpm search --json is-positive [ { "name": "is-positive", "version": "3.1.0", "description": "Check if something is a positive number", "date": "2017-10-24T15:24:08.180Z", "maintainers": [ { "username": "sindresorhus" } ] } ]
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ pnpm add --global markdown
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all packages.
$ pnpm update --global --latest
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the package provided as parameter.
$ pnpm update --global --latest markdown
- cli_names: tuple[str, ...] = ('pnpm',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'pnpm'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
meta_package_manager.managers.pwsh_gallery moduleΒΆ
- class meta_package_manager.managers.pwsh_gallery.PWSH_Gallery[source]ΒΆ
Bases:
PackageManagerPowerShell Gallery client, driven through the modern Microsoft.PowerShell.PSResourceGet module.
Note
Every operation is one PowerShell expression, run non-interactively with no user profile loaded. Reads emit
ConvertTo-Json -AsArrayand are parsed as JSON;outdatedhas no native cmdlet, so its installed-versus-gallery comparison runs inside that singlepwshcall rather than as one round trip per installed module.Note
Only
pwsh(PowerShell 7+) is supported. Legacy Windows PowerShell 5.1 is intentionally excluded: it shipsPowerShellGetv2, which depends on the NuGet provider and prompts to trustPSGalleryon first install.PSResourceGetships bundled withpwsh7.4+ and supersedes the v2 cmdlets with cleaner, JSON-friendly objects.Caution
All install and search operations target
-Scope CurrentUserso thatmpmdoes not require elevation.upgradeandremoveare scope- agnostic and operate on whichever scope holds each module.Caution
Install-PSResourceis invoked with-TrustRepositoryso the confirmation prompt on the defaultPSGalleryrepository is bypassed. Only the default repository is consulted: third-partyPSRepositoryregistrations are out of scope.Initialize
cli_errorslist.- name: str = 'PowerShell Gallery'ΒΆ
The metaclass derives
id = "pwsh-gallery"from the class name (PWSH_Gallery: lowercased, underscoreβdash).namehere is the official product name shown to users.
- homepage_url: str | None = 'https://www.powershellgallery.com'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=7.4.0'ΒΆ
PSResourceGetis bundled with PowerShell 7.4+, which is the floor where every operation below runs without installing extra modules.
- cli_names: tuple[str, ...] = ('pwsh',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- pre_args: tuple[str, ...] = ('-NoProfile', '-NonInteractive', '-Command')ΒΆ
Always invoke
pwshnon-interactively, with no user profile, and run a single-Commandexpression. Each operation passes one PowerShell expression as the final argument; subprocess receives a clean argv list so no shell quoting is required between Python andpwsh.Note
Version detection (
pwsh --version) skipspre_argsbecauseversioncallsrun_cliwithauto_pre_args=False.
- version_regexes: tuple[str, ...] = ('PowerShell\\s+(?P<version>\\S+)',)ΒΆ
$ pwsh --version PowerShell 7.4.6
- property installed: Iterator[Package]ΒΆ
Fetch installed PowerShell resources.
Get-InstalledPSResourceenumerates every module, script and DSC resource in every installed scope. TheVersionproperty is aNuGetVersionobject:ConvertTo-Jsonwould otherwise serialise it as a structured{Major, Minor, ...}mapping, so it is projected to a string up-front.ConvertTo-Json -AsArrayforces a JSON array even when zero or one resource is returned (single results would otherwise be serialised as a bare object).$ pwsh -NoProfile -NonInteractive -Command \ "Get-InstalledPSResource | \ Select-Object Name, @{n='Version';e={$_.Version.ToString()}} | \ ConvertTo-Json -AsArray -Depth 2 -Compress" [{"Name":"PSReadLine","Version":"2.3.6"}, {"Name":"Pester","Version":"5.5.0"}]
- property outdated: Iterator[Package]ΒΆ
Fetch resources with a newer release on the gallery.
PSResourceGethas no built-inoutdatedcmdlet. The comparison is done server-side in a singlepwshinvocation: each installed resource is looked up viaFind-PSResourceand only emitted when the gallery version is strictly greater. Running the loop insidepwshavoids the N+1 round trips that a Python-side comparison would cause.$ pwsh -NoProfile -NonInteractive -Command \ "Get-InstalledPSResource | ForEach-Object { ... } | \ ConvertTo-Json -AsArray -Depth 2 -Compress" [{"Name":"PSReadLine","Installed":"2.3.4","Latest":"2.3.6"}]
- search(query, extended, exact)[source]ΒΆ
Search the gallery.
Find-PSResource -Nameaccepts a wildcard pattern. Wildcards are added aroundqueryfor fuzzy search and dropped for exact match.extendedsearch (matching against description) is not supported byFind-PSResource: results are refiltered in Python by the framework whenextended=True.$ pwsh -NoProfile -NonInteractive -Command \ "Find-PSResource -Name '*readline*' | \ Select-Object Name, @{n='Version';e={$_.Version.ToString()}}, Description | \ ConvertTo-Json -AsArray -Depth 2 -Compress" [{"Name":"PSReadLine","Version":"2.3.6", "Description":"Great command line editing..."}]
- install(package_id, version=None)[source]ΒΆ
Install one resource into the current-user scope.
-TrustRepositorybypasses theUntrusted repositoryprompt thatPSGalleryemits on first install.-AcceptLicensesilently accepts any module-bundled license.-Reinstallis not passed: re-runninginstallon an already-installed resource is a no-op, matchingpip installbehaviour.$ pwsh -NoProfile -NonInteractive -Command \ "Install-PSResource -Name 'PSReadLine' -Scope CurrentUser \ -TrustRepository -AcceptLicense"
- Return type:
- id: str = 'pwsh-gallery'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- upgrade_all_cli()[source]ΒΆ
Upgrade every installed resource to its latest gallery version.
Scope is intentionally not constrained: any installed resource is eligible, regardless of which scope it lives in.
$ pwsh -NoProfile -NonInteractive -Command \ "Update-PSResource -TrustRepository -AcceptLicense"
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
meta_package_manager.managers.scoop moduleΒΆ
- class meta_package_manager.managers.scoop.Scoop[source]ΒΆ
Bases:
PackageManagerScoop is a user-level command-line installer for Windows.
Apps unpack under
~/scoopwithout elevation, so no operation is markedsudo.Documentation:
Note
The
installed,outdatedandsearchlistings are column tables introduced by a---separator line: mpm drops everything up to that separator, then splits each row positionally on whitespace.Attention
scoop --versiondoes not reliably print a clean version: it often emits the rawgit logline of the checkout instead. The probe therefore carries fallbacks that recover the version from atag: vX.Y.Zref or aBump to versioncommit subject. See Scoopβs own version-reporting issue.Caution
removeuninstalls with--purge, so a packageβs persisted data directory is deleted with it rather than kept for a later reinstall.Initialize
cli_errorslist.- homepage_url: str | None = 'https://scoop.sh'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='windows', name='Windows')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=0.2.4'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- version_regexes: tuple[str, ...] = ('^v(?P<version>\\S+)\\s.+', '^.+,\\stag:\\sv(?P<version>\\S+),\\s.+', '^.+\\sBump\\sto\\sversion\\s(?P<version>\\S+)\\s.+')ΒΆ
Search version at the start of a line.
> scoop --version Current Scoop version: v0.2.4 - Released at 2022-08-08 'main' bucket: 5a5b13b6c (HEAD -> master, origin/HEAD) oh-my-posh: Update to version 11.1.1
Attention
Scoop does not always provide a clean version string.
So we fallback on parsing various
git logoutput:> scoop --version Current Scoop version: b588a06e (HEAD -> master, tag: v0.5.3, origin/master, origin/HEAD) Bump 0.5.3 'main' bucket: 46c50c6b0 (HEAD -> master, origin/master, origin/HEAD) fix arm64 version
> scoop --version Current Scoop version: b588a06e chore(release): Bump to version 0.5.3 (resync) (#6436) 'main' bucket: 46c50c6b0 aqua: fix arm64 version (#7071)
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
> scoop list Installed apps: Name Version Source Updated Info ---- ------- ------ ------- ---- 7zip 22.01 main 2022-09-27 08:03:30 dark 3.11.2 main 2022-09-27 08:04:26 git 2.37.3.windows.1 main 2022-09-27 08:03:58 python 3.10.7 main 2022-09-27 08:04:53
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
> scoop status Name Installed Version Latest Version Missing Dependencies Info ---- ----------------- -------------- -------------------- ---- demulshooter 16.7.2 18.7.3 eduke32 20220611-10112 20220709-10115 Teracopy-np yuzu-pineapple EA-2804 EA-2830
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not support extended or exact matching. So we return the best subset of results and let
meta_package_manager.manager.PackageManager.refiltered_search()refine them.> scoop search zip Results from local buckets... Name Version Source Binaries ---- ------- ------ -------- 7zip 22.01 main 7zip19.00-helper 19.00 main busybox 4716-g31467ddfc main bunzip2 | gunzip | gzip | unzip bzip2 1.0.8.0 main gow 0.8.0 main bunzip2.exe | bzip2.exe | zip.exe gzip 1.3.12 main lzip 1.20 main unzip 6.00 main zip 3.0 main
- install(package_id, version=None)[source]ΒΆ
Install one package.
> scoop install 7zip Installing '7zip' (22.01) [64bit] from main bucket 7z2201-x64.msi (1.8 MB) [====================] 100% Checking hash of 7z2201-x64.msi ... ok. Extracting 7z2201-x64.msi ... done. Linking ~\scoopppszip\current => ~\scoopppszip.01 Creating shim for '7z'. Creating shortcut for 7-Zip (7zFM.exe) Persisting Codecs Persisting Formats Running post_install script... '7zip' (22.01) was installed successfully! Notes ----- Add 7-Zip as a context menu by running: "C:\scoop\...install-context.reg"
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
> scoop update --all
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
> scoop update 7zip
- remove(package_id)[source]ΒΆ
Remove one package.
> scoop uninstall 7zip --purge Uninstalling '7zip' (22.01). Removing shim '7z.shim'. Removing shim '7z.exe'. Removing shortcut ~\AppData\Roaming\Scoop Apps-Zip.lnk Unlinking ~\scoopppszip\current '7zip' was uninstalled.
- Return type:
- sync()[source]ΒΆ
Sync package metadata.
> scoop status WARN Scoop out of date. Run 'scoop update' to get the latest changes.
> scoop update Updating Scoop... Updating 'main' bucket... Converting 'main' bucket to git repo... Checking repo... OK The main bucket was added successfully. Scoop was updated successfully!
> scoop status Scoop is up to date. Everything is ok!
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
> scoop cleanup --all --cache Everything is shiny now!
- Return type:
- cli_names: tuple[str, ...] = ('scoop',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
meta_package_manager.managers.sdkman moduleΒΆ
- class meta_package_manager.managers.sdkman.SDKMAN[source]ΒΆ
Bases:
PackageManagerSDKMAN! manages parallel versions of multiple Software Development Kits on Unix-based systems.
Note
SDKMAN! primarily serves the JVM ecosystem: Java, Gradle, Maven, Kotlin, Scala, and ~115 other candidates. Each candidate is treated as a package.
Caution
The
sdkcommand is a shell function, not a standalone binary, so mpm detects SDKMAN by its init script (sdkman-init.sh) rather than a binary onPATHand wraps every invocation inbash -c 'source <init> && sdk <args>'.Note
SDKMAN has no read-only βoutdatedβ verb, so
outdatedpipesnintosdk upgradeto capture the candidate list without applying any upgrade.Initialize
cli_errorslist.- homepage_url: str | None = 'https://sdkman.io'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=5.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- cli_names: tuple[str, ...] = ('sdkman-init.sh',)ΒΆ
Detect SDKMAN by the presence of its init script.
- cli_search_path: tuple[str, ...] = ('/home/runner/.sdkman/bin',)ΒΆ
List of additional path to help mpm hunt down the package manager CLI.
Must be a list of strings whose order dictates the search sequence.
Most of the time unnecessary:
meta_package_manager.manager.PackageManager.cli_path()works well on all platforms.
- extra_env: ClassVar = {'sdkman_auto_answer': 'true', 'sdkman_colour_enable': 'false'}ΒΆ
Disable ANSI colors and auto-accept interactive prompts.
- version_cli_options: tuple[str, ...] = ('version',)ΒΆ
CLI options used to produce the version of the package manager.
The raw output produced by the package manager CLI will be parsed with the
version_regexesbelow to extract the version number.
- version_regexes: tuple[str, ...] = ('script:\\s+(?P<version>\\S+)',)ΒΆ
$ sdk version SDKMAN! script: 5.18.2 native: 0.4.6
- build_cli(*args, **kwargs)[source]ΒΆ
Wrap all CLI invocations to source the SDKMAN init script in bash.
Note
The
**kwargsaccepted by the base class (auto_pre_args,sudo, etc.) are accepted but ignored because every invocation goes through thebash -cwrapper and SDKMAN never requires elevated privileges.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ sdk current Using: groovy: 4.0.22 java: 21.0.4-tem scala: 3.4.2
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ echo n | sdk upgrade Available defaults: gradle (local: 2.3, 1.11; default: 8.9) java (local: 21.0.4-tem; default: 25.0.2-tem) Use prescribed default version(s)? (Y/n):
Note
Pipes
ntosdk upgradeto obtain the outdated list without actually performing the upgrade. Overridessdkman_auto_answertofalseso the command prints the candidate list before prompting.
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ sdk install java 21.0.4-tem
- Return type:
- id: str = 'sdkman'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- name: str = 'SDKMAN'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade one package.
$ sdk upgrade java
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- remove(package_id)[source]ΒΆ
Remove one package.
SDKMANβs
uninstallcommand requires both the candidate and a specific version. The currently installed version is looked up frominstalled()and passed to the CLI.$ sdk uninstall java 21.0.4-tem
- Return type:
meta_package_manager.managers.sfsu moduleΒΆ
- class meta_package_manager.managers.sfsu.SFSU[source]ΒΆ
Bases:
PackageManagersfsu (Scoop For Speed and Usability) is a Rust reimplementation of Scoopβs slower read paths, working against the same buckets and
~/scoopinstall tree.mpm reaches for sfsu only where it is both faster than Scoop and speaks JSON:
installed,outdatedandsearchall pass--jsonand are parsed as structured objects instead of the whitespace tables Scoop prints.Note
sfsu implements no mutating verbs, so
install,removeand both upgrade commands are bound straight toScoopthrough theDelegatedescriptor: those operations run thescoopbinary, and a host with sfsu but no Scoop cannot mutate anything.Initialize
cli_errorslist.- name: str = 'Scoop sfsu'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/winpax/sfsu'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='windows', name='Windows')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=1.16.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- post_args: tuple[str, ...] = ('--no-color',)ΒΆ
Global list of options used before and after the invoked package manager CLI.
Automatically added to each
meta_package_manager.manager.PackageManager.run_cli()call.Essentially used to force silencing, low verbosity or no-color output.
- version_regexes: tuple[str, ...] = ('sfsu\\s+(?P<version>\\S+)',)ΒΆ
> sfsu --version sfsu 1.17.2 sprinkles 0.22.0 (crates.io published version)
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
> sfsu list --json [ { "name": "7zip", "version": "26.00", "source": "main", "updated": "2026-03-18 17:54:32", "notes": "" }, { "name": "git", "version": "2.53.0.3", "source": "main", "updated": "2026-03-15 09:12:04", "notes": "" } ]
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
Uses
sfsu status --only apps --jsonwhich returns packages with available updates.> sfsu status --only apps --json { "packages": [ { "name": "git", "current": "2.53.0.2", "available": "2.53.0.3", "missing_dependencies": [], "info": null } ] }
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search does not support extended or exact matching. Results are refiltered by
meta_package_manager.manager.PackageManager.refiltered_search().> sfsu search --json git { "main": [ { "name": "git", "bucket": "main", "version": "2.53.0.3", "installed": true, "bins": [] }, ... ], ... }
- installΒΆ
Install one package.
> scoop install 7zip Installing '7zip' (22.01) [64bit] from main bucket 7z2201-x64.msi (1.8 MB) [====================] 100% Checking hash of 7z2201-x64.msi ... ok. Extracting 7z2201-x64.msi ... done. Linking ~\scoopppszip\current => ~\scoopppszip.01 Creating shim for '7z'. Creating shortcut for 7-Zip (7zFM.exe) Persisting Codecs Persisting Formats Running post_install script... '7zip' (22.01) was installed successfully! Notes ----- Add 7-Zip as a context menu by running: "C:\scoop\...install-context.reg"
- upgrade_all_cliΒΆ
Generates the CLI to upgrade all outdated packages.
> scoop update --all
- upgrade_one_cliΒΆ
Generates the CLI to upgrade the provided package.
> scoop update 7zip
- removeΒΆ
Remove one package.
> scoop uninstall 7zip --purge Uninstalling '7zip' (22.01). Removing shim '7z.shim'. Removing shim '7z.exe'. Removing shortcut ~\AppData\Roaming\Scoop Apps-Zip.lnk Unlinking ~\scoopppszip\current '7zip' was uninstalled.
- sync()[source]ΒΆ
Sync package metadata.
Uses sfsuβs native
updatecommand which updates Scoop and all buckets.> sfsu update --no-color
- Return type:
- cleanup()[source]ΒΆ
Removes old versions of all installed apps and clears the cache.
> sfsu cleanup --all --cache --no-color
- Return type:
- cli_names: tuple[str, ...] = ('sfsu',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
meta_package_manager.managers.snap moduleΒΆ
- class meta_package_manager.managers.snap.Snap[source]ΒΆ
Bases:
PackageManagerCanonicalβs snap installs sandboxed, self-updating packages.
snaps refresh themselves on a schedule, so
upgrademerely forces asnap refreshsooner. No operation is markedsudo: thesnapddaemon performs the privileged work.Note
snap localizes and colorizes its table headers with no terminal detection. mpm pins nothing to English:
--color=neverstrips the ANSI, the header row is dropped, and every row is split on whitespace and read by column position, so the translated headers never reach the parser.Note
snap refresh --listreports only the available version, sooutdatedlooks each installed version up by ID from the cached installed set.searchrunssnap find, which matches summaries as well as names, so mpm refilters the results.Initialize
cli_errorslist.- homepage_url: str | None = 'https://snapcraft.io'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=2.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- post_args: tuple[str, ...] = ('--color=never',)ΒΆ
Global list of options used before and after the invoked package manager CLI.
Automatically added to each
meta_package_manager.manager.PackageManager.run_cli()call.Essentially used to force silencing, low verbosity or no-color output.
- version_regexes: tuple[str, ...] = ('snap\\s+(?P<version>\\S+)',)ΒΆ
$ snap --version snap 2.44.1 snapd 2.44.1 series 16 linuxmint 19.3 kernel 4.15.0-91-generic
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ snap list --color=never Name Version Rev Aufzeichnung Herausgeber Hinweise core 16-2.44.1 8935 latest/stable canonicalβ core wechat 2.0 7 latest/stable ubuntu-dawndiy - pdftk 2.02-4 9 latest/stable smoser -
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ snap refresh --list --color=never Name Version Rev Herausgeber Hinweise standard-notes 3.3.5 8 standardnotesβ -
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
Search is extended by default. So we return the best subset of results and let
meta_package_manager.manager.PackageManager.refiltered_search()refine them.$ snap find doc --color=never Name Version Herausgeber Hinweise Zusammenfassung journey 2.14.3 2appstudio - Your private diary. nextcloud 17.0.5snap1 nextcloudβ - Nextcloud Server skype 8.58.0.93 skypeβ classic One Skype for all.
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ snap install standard-notes --color=never
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ snap refresh --color=never
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ snap refresh standard-notes --color=never
- cli_names: tuple[str, ...] = ('snap',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'snap'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
meta_package_manager.managers.sun_tools moduleΒΆ
- class meta_package_manager.managers.sun_tools.Sun_Tools[source]ΒΆ
Bases:
PackageManagerSolarisβ legacy System V Release 4 packaging tools.
Documentation:
https://docs.oracle.com/cd/E86824_01/html/E54763/pkginfo-1.html
https://docs.oracle.com/cd/E26502_01/html/E29031/pkgadd-1m.html
https://docs.oracle.com/cd/E26502_01/html/E29031/pkgrm-1m.html
The suite spans several binaries:
pkginfo(the read-only query tool, used as the main CLI),pkgaddandpkgrm.Note
SVR4 packages come from local media or datastream files, not a network repository: there is no catalog to search, refresh or diff against, and
pkgaddinstalls a specific local artifact rather than resolving a name. Onlyinstalledandremoveare therefore implemented; Solaris 11βs modern repository-based interface is IPS (pkg), a different manager.Initialize
cli_errorslist.- name: str = 'Solaris SVR4 package tools'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://docs.oracle.com/cd/E86824_01/html/E54763/pkginfo-1.html'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='solaris', name='Solaris')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- cli_names: tuple[str, ...] = ('pkginfo',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- cli_search_path: tuple[str, ...] = ('/usr/sbin',)ΒΆ
List of additional path to help mpm hunt down the package manager CLI.
Must be a list of strings whose order dictates the search sequence.
Most of the time unnecessary:
meta_package_manager.manager.PackageManager.cli_path()works well on all platforms.
- version_cli: str | None = 'uname'ΒΆ
None of the SVR4 tools has a version flag:
pkginfo -vmatches a package version andpkgadd/pkgrmonly take-vas verbose. The suite ships with the base system, so its version is the OS release reported byuname -r(5.11on Solaris 11).
- version_cli_options: tuple[str, ...] = ('-r',)ΒΆ
CLI options used to produce the version of the package manager.
The raw output produced by the package manager CLI will be parsed with the
version_regexesbelow to extract the version number.
- id: str = 'sun-tools'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
Plain
pkginfoprints no version column (only category, package instance and name), so the long-llisting is parsed instead: each package is a multi-line block carryingPKGINST:,VERSION:andSTATUS:fields. Only completely-installed packages are yielded.$ pkginfo -l PKGINST: SUNWcar NAME: Core Architecture, (Root) CATEGORY: system ARCH: i386.i86pc VERSION: 11.10.0,REV=2005.01.21.16.34 BASEDIR: / VENDOR: Oracle Corporation STATUS: completely installed
meta_package_manager.managers.tazpkg moduleΒΆ
- class meta_package_manager.managers.tazpkg.Tazpkg[source]ΒΆ
Bases:
PackageManagerSliTaz GNU/Linuxβs package manager.
Documentation:
Note
tazpkg decorates every listing with localized, colorized titles, separators and count footers, with no terminal detection:
LC_ALL=Cpins the text to English,--output=rawswitches the decorations to plain text, and any remaining ANSI sequence is stripped before parsing. Data rows are then matched by their digit-led version column, which no decoration line carries.Note
No
outdatedoperation:tazpkg up --checkrequires root and recharges the package lists from the mirror even when only listing, so there is no cleanly read-only upgradable listing.Initialize
cli_errorslist.- name: str = 'TazPkg'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://slitaz.org'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='slitaz', name='SliTaz GNU/Linux')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- extra_env: ClassVar = {'LC_ALL': 'C'}ΒΆ
Additional environment variables to add to the current context.
Automatically applied on each
meta_package_manager.manager.PackageManager.run_cli()calls.
- post_args: tuple[str, ...] = ('--output=raw',)ΒΆ
Global list of options used before and after the invoked package manager CLI.
Automatically added to each
meta_package_manager.manager.PackageManager.run_cli()call.Essentially used to force silencing, low verbosity or no-color output.
- version_cli: str | None = 'awk'ΒΆ
tazpkg has no version command at all: its own version only exists as the
tazpkgrow of the installed-packages database. This probe mirrors, verbatim, how tazpkg resolves itsVERSIONvariable for itself:export VERSION=$(awk -F$'\t' '$1=="tazpkg"{print $2}' \ "$PKGS_DB/installed.info")
- version_cli_options: tuple[str, ...] = ('-F\t', '$1=="tazpkg"{print $2}', '/var/lib/tazpkg/installed.info')ΒΆ
CLI options used to produce the version of the package manager.
The raw output produced by the package manager CLI will be parsed with the
version_regexesbelow to extract the version number.
- version_regexes: tuple[str, ...] = ('^(?P<version>[\\d.]+)$',)ΒΆ
A bare integer Mercurial revision on cooking releases (
944) or a dotted version on stable ones (4.9.2).
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ tazpkg list --output=raw List of all installed packages ================================================================================ busybox 1.36.0 base-system nano 6.2 editors ================================================================================ 2 packages installed.
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
tazpkg matches the query as a case-insensitive substring of
name-version, over installed then mirrored packages.$ tazpkg search nano --output=raw Installed packages -------------------------------------------------------------------------------- nano 6.2 editors -------------------------------------------------------------------------------- 1 installed package found for: nano
- install(package_id, version=None)[source]ΒΆ
Install one package from the mirror.
--forcedskips the already-installed guard, keeping the call non-interactive.$ sudo tazpkg get-install nano --forced --output=raw
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all packages.
-i(no long form) auto-confirms, upgrading every outdated package; the command recharges the package lists first.$ sudo tazpkg up -i --output=raw
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade one package.
tazpkg has no per-package upgrade verb: its own upgrade loop re-runs
get-install --forcedon each outdated package.$ sudo tazpkg get-install nano --forced --output=raw
- cli_names: tuple[str, ...] = ('tazpkg',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'tazpkg'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- remove(package_id)[source]ΒΆ
Remove one package.
No
--autoon purpose: it would also auto-confirm the βremove dependents?β follow-up and cascade. On a non-terminal stdout (mpmβs subprocess pipe) the(y/N)prompt is skipped and only the target package is removed.$ sudo tazpkg remove nano --output=raw
- Return type:
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
meta_package_manager.managers.uv moduleΒΆ
- class meta_package_manager.managers.uv.UVBase[source]ΒΆ
Bases:
PackageManagerVirtual base shared by the
UVandUVXmanagers defined below.Initialize
cli_errorslist.- homepage_url: str | None = 'https://docs.astral.sh/uv'ΒΆ
Home page of the project, only used in documentation for reference.
- requirement: str | None = '>=0.5.0'ΒΆ
0.5.0 is the first version to introduce
pip list --outdatedcommand.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- virtual: bool = TrueΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- cooldown_env_var: ClassVar[str | None] = 'UV_EXCLUDE_NEWER'ΒΆ
uv honors a release-age cooldown through its
exclude-newerresolver option.UV_EXCLUDE_NEWERmirrors the--exclude-newerflag and is read by every resolving subcommand (pip install,pip list --outdated,tool install,tool upgrade), so a single environment variable covers install, upgrade and outdated at once. uv accepts an RFC 3339 timestamp, which is exactly what the defaultmeta_package_manager.execution.CLIExecutor.cooldown_env_value()produces.See https://docs.astral.sh/uv/reference/settings/#exclude-newer.
- pre_args: tuple[str, ...] = ('--color', 'never', '--no-progress')ΒΆ
--color color-choiceControl colors in output [default:
auto]Possible values: -
auto: Enables colored output only when the output is going to a terminal or TTY with support -always: Enables colored output regardless of the detected environment -never: Disables colored output
--no-progressHide all progress outputs.
For example, spinners or progress bars.
- version_regexes: tuple[str, ...] = ('uv\\s+(?P<version>\\S+)',)ΒΆ
$ uv --version uv 0.2.21 (ebfe6d8fc 2024-07-03)
- cli_names: tuple[str, ...] = ('uvbase',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- class meta_package_manager.managers.uv.UV[source]ΒΆ
Bases:
UVBasePython packages managed with uvβs
uv pipinterface.Installed and outdated packages are read with
uv pip list(adding--outdatedand--format=json), acting on whatever environment uv resolves, exactly as a bareuv pipcall in the same shell would. The--outdatedlisting sets the>=0.5.0version floor, the first uv release to ship it. The release-age cooldown rides on uvβs--exclude-newerresolver option, which every resolving subcommand honors, so one cutoff covers install, upgrade and outdated together.Hint
Package specs are passed unquoted, working around uv parse failures on quoted specs.
Initialize
cli_errorslist.- name: str = 'Python uv'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ uv --color never --no-progress pip list --format=json [ { "name": "markupsafe", "version": "2.1.5" }, { "name": "meta-package-manager", "version": "5.17.0", "editable_project_location": "/Users/kde/meta-package-manager" }, { "name": "myst-parser", "version": "3.0.1" } ]
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ uv --color never --no-progress pip list --outdated --format=json [ { "name": "lark-parser", "version": "0.7.8", "latest_version": "0.12.0", "latest_filetype": "wheel" }, { "name": "types-setuptools", "version": "75.3.0.20241107", "latest_version": "75.3.0.20241112", "latest_filetype": "wheel" } ]
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ uv --color never --no-progress pip install arrow
- Return type:
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the package provided as parameter.
$ uv --color never --no-progress pip install --upgrade arrow
- remove(package_id)[source]ΒΆ
Remove one package.
$ uv --color never --no-progress pip uninstall arrow
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
$ uv --color never --no-progress cache clean Clearing cache at: /Users/kde/Library/Caches/uv Removed 97279 files (2.0GiB)
$ uv --color never --no-progress cache prune No cache found at: /Users/kde/.cache/uv
- Return type:
- cli_names: tuple[str, ...] = ('uv',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- class meta_package_manager.managers.uv.UVX[source]ΒΆ
Bases:
UVBaseuvβs tool manager for isolated Python applications, like
pipx.mpm drives the
uv toolsubcommands; each application lives in its own venv. Installed and outdated tools are parsed from the plain-texttool listandtool list --outdatedoutput: unlike theuv pipinterface,uv toolemits no JSON. The--outdatedlisting sets the>=0.10.10version floor, the first uv release to ship it. The release-age cooldown rides on uvβs--exclude-newerresolver option, covering install, upgrade and outdated through one cutoff.Hint
Package specs are passed unquoted, working around uv parse failures on quoted specs.
Initialize
cli_errorslist.- name: str = 'Python uvx'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://docs.astral.sh/uv/guides/tools/'ΒΆ
Home page of the project, only used in documentation for reference.
- brewfile_entry_type: ClassVar[str | None] = 'uv'ΒΆ
uvis mapped to Homebrew Bundleβsuventry type, which installs viauv tool installβ the same mechanismUVXwraps. The pip-styleUVmanager intentionally has no Brewfile mapping: its packages live inside a Python environment, not as top-level tools, so the semantics do not round-trip throughbrew bundle.
- requirement: str | None = '>=0.10.10'ΒΆ
0.10.10 is the first version to introduce
tool list --outdatedcommand.
- cli_names: tuple[str, ...] = ('uv',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'uvx'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ uv --color never --no-progress tool list pycowsay v0.0.0.1 - pycowsay
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ uv --color never --no-progress tool list --outdated pycowsay v0.0.0.1 [latest: 0.0.0.2] - pycowsay
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ uv --color never --no-progress tool install pycowsay
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all packages.
$ uv --color never --no-progress tool upgrade --all Updated pycowsay v0.0.0.1 -> v0.0.0.2 - pycowsay
meta_package_manager.managers.winget moduleΒΆ
- class meta_package_manager.managers.winget.WinGet[source]ΒΆ
Bases:
PackageManagerMicrosoftβs official Windows package manager.
mpm reads inventory from
winget list --details, whoseKey: Valueblocks carry the installed version and anAvailable Upgradessection, and readssearchfrom wingetβs fixed-width column table.Note
installedandoutdatedkeep only rows whoseOrigin Sourceiswinget, dropping packages winget merely tracks (sideloaded, portable or Microsoft Store). Store entries still surface insearch, but their real version cannot be queried throughwinget, so mpm tags them with anmsstoresentinel version and sorts them below winget-native ones.Warning
Two Windows-only, process-level workarounds keep winget from taking the calling process down with it:
winget is spawned with
DETACHED_PROCESS. Its COM server and installer children callGenerateConsoleCtrlEventas they shut down, broadcasting aCTRL_C_EVENTto every process sharing their console: detaching removes winget from that console, so the signal never reaches the caller.WindowsPackageManagerServer.exeis killed by image name after each call. This COM server is activated out-of-process, so it never inherits mpmβs pipes and is never reaped bycommunicate().
Initialize
cli_errorslist.- homepage_url: str | None = 'https://github.com/microsoft/winget-cli'ΒΆ
Home page of the project, only used in documentation for reference.
- brewfile_entry_type: ClassVar[str | None] = 'winget'ΒΆ
Name of the Brewfile DSL entry type this manager maps to, or
Noneif the manager has no Brewfile equivalent.Set by the subset of managers covered by Homebrew Bundleβs DSL (
brew,cask,mas,vscode,npm,cargo,uv,winget,flatpak). Consumed bymeta_package_manager.brewfilewhen rendering the output ofmpm dump --brewfile.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='windows', name='Windows')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- requirement: str | None = '>=1.28.190'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- post_args: tuple[str, ...] = ('--accept-source-agreements', '--disable-interactivity')ΒΆ
--accept-source-agreements:Used to accept the source license agreement, and avoid the following prompt:
PS C:\Users\kev> winget list The "msstore' source requires that you view the following agreements before using. Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transaction The source requires the current machine's 2-letter geographic region to be sent to the backend service to function prope rly (ex. "US"). Do you agree to all the source agreements terms? [Y] Yes [N] No:
--disable-interactivity:Disable interactive prompts.
Todo
Add the
--no-progressoption once it is available in the stable release:
- version_regexes: tuple[str, ...] = ('v(?P<version>\\S+)',)ΒΆ
PS C:\Users\kev> winget --version v1.28.220
- windows_creation_flags: int = 0ΒΆ
Detach winget from the calling processβs console.
When winget runs, the Windows COM infrastructure activates
WindowsPackageManagerServer.exeas a separate process. Installer EXEs launched bywinget upgradeorwinget installare also spawned as grandchildren. Both the COM server and any installer EXEs callGenerateConsoleCtrlEvent(0)during their own shutdown, which broadcasts aCTRL_C_EVENTto every process sharing the same console β including the Python test runner β causing it to exit with code 1 even after all tests pass.DETACHED_PROCESSbreaks the shared-console link: winget has no console, so neither the COM server nor any installer EXE can broadcast console events that reach us. Output is still captured because stdout and stderr are redirected to pipes, which are independent of console attachment.
- windows_processes_to_cleanup: tuple[str, ...] = ('WindowsPackageManagerServer.exe',)ΒΆ
Kill wingetβs COM server after each call.
WindowsPackageManagerServer.exeis activated by the Windows COM infrastructure when winget runs, not as a direct child process. It therefore does not inherit our pipe handles and is not reaped bycommunicate(). Kill it by image name after each call to avoid accumulating orphan COM server processes.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
PS C:\Users\kev> winget list --details --accept-source-agreements --disable-interactivity (1/7) CCleaner [CCleaner] Version: 6.08 Publisher: Piriform Software Ltd Local Identifier: ARP\Machine\X64\CCleaner Product Code: CCleaner Installer Category: exe Installed Scope: Machine Installed Architecture: X64 Installed Locale: en-US Origin Source: winget Available Upgrades: (2/7) Git [Git.Git] Version: 2.37.3 Publisher: The Git Development Community Origin Source: winget
Only returns packages with Origin Source: winget to exclude packages installed via other sources (e.g., sideload, portable).
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
PS C:\Users\kev> winget list --upgrade-available --details --accept-source-agreements --disable-interactivity (1/4) Git [Git.Git] Version: 2.37.3 Publisher: The Git Development Community Origin Source: winget Available Upgrades: winget [2.45.1] (2/4) Microsoft Edge [Microsoft.Edge] Version: 109.0.1518.70 Publisher: Microsoft Origin Source: winget Available Upgrades: winget [125.0.2535.51]
Only returns packages with Origin Source: winget to exclude packages installed via other sources (e.g., sideload, portable).
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
PS C:\Users\kev> winget search --query vscode --accept-source-agreements --disable-interactivity Name Id Version Match Source --------------------------------------------------------------------------------------------------------- Microsoft Visual Studio Code Microsoft.VisualStudioCode 1.89.1 Moniker: vscode winget MrCode zokugun.MrCode 1.82.0.23253 Tag: vscode winget VSCodium Insiders VSCodium.VSCodium.Insiders 1.88.0.24095 Tag: vscode winget VSCodium VSCodium.VSCodium 1.89.1.24130 Tag: vscode winget Upgit pluveto.Upgit 0.2.18 Tag: vscode winget vscli michidk.vscli 0.3.0 Tag: vscode winget Huawei QuickApp IDE Huawei.QuickAppIde 14.0.1 Tag: vscode winget TheiaBlueprint EclipseFoundation.TheiaBlueprint 1.44.0 Tag: vscode winget Codium Alex313031.Codium 1.86.2.24053 Tag: vscode winget Cursor Editor CursorAI,Inc.Cursor latest Tag: vscode winget Microsoft Visual Studio Code CLI Microsoft.VisualStudioCode.CLI 1.89.1 Moniker: vscode-cli winget
PS C:\Users\kev> winget search --query vscode --exact --accept-source-agreements --disable-interactivity Name Id Version Match Source ------------------------------------------------------------------------------------------------- Microsoft Visual Studio Code Microsoft.VisualStudioCode 1.89.1 Moniker: vscode winget MrCode zokugun.MrCode 1.82.0.23253 Tag: vscode winget VSCodium Insiders VSCodium.VSCodium.Insiders 1.88.0.24095 Tag: vscode winget VSCodium VSCodium.VSCodium 1.89.1.24130 Tag: vscode winget Upgit pluveto.Upgit 0.2.18 Tag: vscode winget vscli michidk.vscli 0.3.0 Tag: vscode winget Huawei QuickApp IDE Huawei.QuickAppIde 14.0.1 Tag: vscode winget TheiaBlueprint EclipseFoundation.TheiaBlueprint 1.44.0 Tag: vscode winget Codium Alex313031.Codium 1.86.2.24053 Tag: vscode winget Cursor Editor CursorAI,Inc.Cursor latest Tag: vscode winget
PS C:\Users\kev> winget search --id VSCodium.VSCodium --accept-source-agreements --disable-interactivity Name Id Version Source ---------------------------------------------------------------- VSCodium Insiders VSCodium.VSCodium.Insiders 1.88.0.24095 winget VSCodium VSCodium.VSCodium 1.89.1.24130 winget
PS C:\Users\kev> winget search --name Codium --accept-source-agreements --disable-interactivity Name Id Version Source ---------------------------------------------------------------- Codium Alex313031.Codium 1.86.2.24053 winget VSCodium Insiders VSCodium.VSCodium.Insiders 1.88.0.24095 winget VSCodium VSCodium.VSCodium 1.89.1.24130 winget
PS C:\Users\kev> winget search --id VSCodium.VSCodium --exact --accept-source-agreements --disable-interactivity Name Id Version Source ---------------------------------------------- VSCodium VSCodium.VSCodium 1.89.1.24130 winget
PS C:\Users\kev> winget search --name Codium --exact --accept-source-agreements --disable-interactivity Name Id Version Source -------------------------------------------- Codium Alex313031.Codium 1.86.2.24053 winget
- install(package_id, version=None)[source]ΒΆ
Install one package.
PS C:\Users\kev> winget install --id Microsoft.PowerToys --accept-package-agreements --version 0.15.2 --accept-source-agreements --disable-interactivity Found Power Toys [Microsoft.PowerToys] Version 0.15.2 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Successfully verified installer hash Starting package install... ββββββββββββββββββββββββββββββ 100% Successfully installed
- Return type:
- cli_names: tuple[str, ...] = ('winget',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- id: str = 'winget'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- name: str = 'WinGet'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
PS C:\Users\kev> winget upgrade --all --accept-package-agreements --accept-source-agreements --disable-interactivity Name Id Version Available Source ------------------------------------------------------------------------------------------------ Microsoft Edge Microsoft.Edge 109.0.1518.70 125.0.2535.51 winget Microsoft Edge WebView2 Runtime Microsoft.EdgeWebView2Runtime 109.0.1518.70 125.0.2535.51 winget Python Launcher Python.Launchez < 3.12.0 3.12.0 winget Microsoft Visual C++ (x86)... Microsoft.VCRedist.2015+.X86 14.34.31931.0 14.38.33135.0 winget 4 upgrades available. Installing dependencies: This package requires the following dependencies: - Packages Microsoft.UI.Xaml.2.8 [>= 8.2306.22001.0] (1/3) Found Microsoft Edge WebView2 Runtime [Microsoft.EdgeWebView2Runtime] Version 125. 0.2535.51 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Downloading https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/e5dd841e-17ff-43b7-a2c0-ff759f55c202/MicrosoftEdgeWebView2RuntimeInstallerARM64.exe ββββββββββββββββββββββββββββββ 166 MB / 166 MB Successfully verified installer hash Starting package install... Successfully installed (...)
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
PS C:\Users\kev> winget upgrade --id Git.Git --accept-package-agreements --accept-source-agreements --disable-interactivity Found Git [Git.Git] Version 2.45.1 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Downloading https://github.com/git-for-windows/git/releases/download/v2.45.1.windows.1/Git-2.45.1-64-bit.exe ββββββββββββββββββββββββββββββ 64.7 MB / 64.7 MB Successfully verified installer hash Starting package install... Successfully installed
Todo
Automatically uninstall the package if the technology is different:
PS C:\Users\kev> winget upgrade --id Microsoft.Edge A newer version was found, but the install technology is different from the current version installed. Please uninstall the package and install the newer version.
- remove(package_id)[source]ΒΆ
Remove one package.
PS C:\Users\kev> winget uninstall --id Microsoft.PowerToys --source winget --accept-source-agreements --disable-interactivity Found PowerToys (Preview) [Microsoft.PowerToys] Starting package uninstall... ββββββββββββββββββββββββββββββ 100% Successfully uninstalled
- Return type:
meta_package_manager.managers.xbps moduleΒΆ
- class meta_package_manager.managers.xbps.XBPS[source]ΒΆ
Bases:
PackageManagerX Binary Package System used by Void Linux.
Note
XBPS is split across several sibling binaries:
xbps-queryfor read-only operations,xbps-installfor installs, sync and upgrades, andxbps-removefor uninstalls and cache cleanup.mpmresolves the siblings from the same directory ascli_path.Initialize
cli_errorslist.- name: str = 'Void XBPS'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://github.com/void-linux/xbps'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='debian', name='Debian'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- requirement: str | None = '>=0.59'ΒΆ
Version 0.59 is the first to ship the long-form options (
--list-pkgs,--repository,--search,--update,--dry-run,--sync,--yes,--clean-cache,--remove-orphans) that the methods below depend on.
- cli_names: tuple[str, ...] = ('xbps-install',)ΒΆ
Use
xbps-installas the canonical entry point.The other XBPS binaries (
xbps-query,xbps-remove) are looked up in the same directory asxbps-installviacli_path.
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ xbps-query --list-pkgs ii base-files-0.144_1 Void Linux base system files ii cmark-gfm-0.29.0.gfm.13_1 CommonMark parsing and rendering library ii curl-8.5.0_1 Command line tool for transferring data
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
Caution
Reads from the local repository cache. Run
sync()first to refresh the index.$ xbps-install --update --dry-run firefox-120.0_1 update x86_64 https://repo-default.voidlinux.org/current 45MB 12MB python3-3.11.6_2 update x86_64 https://repo-default.voidlinux.org/current 30MB 8MB
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Caution
xbps-query --searchmatches againstpkgverandshort_descproperties at the same time. Extended and exact matching are not supported, so the best subset of results is returned and refined later bymeta_package_manager.manager.PackageManager.refiltered_search().$ xbps-query --repository --search firefox [-] firefox-120.0_1 Standalone web browser from mozilla.org [*] firefox-esr-115.5.0_1 Extended support release of Firefox
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ sudo xbps-install --yes firefox
- Return type:
- id: str = 'xbps'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all packages.
$ sudo xbps-install --sync --update --yes
- virtual: bool = FalseΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade one package.
$ sudo xbps-install --update --yes firefox
- remove(package_id)[source]ΒΆ
Remove one package, recursively dropping orphaned dependencies.
$ sudo xbps-remove --recursive --yes firefox
- Return type:
meta_package_manager.managers.yarn moduleΒΆ
- class meta_package_manager.managers.yarn.Yarn[source]ΒΆ
Bases:
PackageManagerVirtual base shared by Yarn Classic and Yarn Berry.
The two Yarn lines grew incompatible CLIs, so mpm models them as separate managers,
YarnClassicandYarnBerry, both invoking the sameyarnbinary. The reported version decides which one is active: Classic claims the1.xrange, Berry2.xand later. Only the shared cache-cleanup operation lives on this base.Command equivalences with the sibling JS managers are listed at https://github.com/antfu-collective/ni?tab=readme-ov-file#ni.
Initialize
cli_errorslist.- homepage_url: str | None = 'https://yarnpkg.com'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='macos', name='macOS'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='windows', name='Windows'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- virtual: bool = TrueΒΆ
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
See: https://yarnpkg.com/cli/cache/clean
$ yarn cache clean --all yarn cache v1.22.19 success Cleared cache. β¨ Done in 0.35s.
- Return type:
- cli_names: tuple[str, ...] = ('yarn',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- class meta_package_manager.managers.yarn.YarnClassic[source]ΒΆ
Bases:
YarnYarn Classic, the
1.xline.mpm claims this class for any
yarnbinary reporting a1.xversion and drives it through theyarn globalcommand family, so installs, upgrades and removals target the global prefix. Its--jsonoutput is a stream of one JSON object per line, not a single document, so every query is parsed line by line.Warning
Yarn Classic has been in maintenance mode since January 2020, taking only critical and security patches. Yarn Berry (
2.xand later) is the actively developed line but exposes a different CLI surface, so mpm handles it through a separateYarnBerrymanager.Note
Yarn has no dedicated search command by maintainer decision, so
searchis simulated withyarn infoand only resolves exact package names.Initialize
cli_errorslist.- id: str = 'yarn'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- name: str = 'Yarn Classic'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- requirement: str | None = '>=1.20.0,<2.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- cli_names: tuple[str, ...] = ('yarn',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ yarn global --json list --depth 0 {"type":"activityStart","data":{"id":0}} {"type":"activityTick","data":{"id":0,"name":"awesome-lint@^0.18.0"}} {"type":"activityTick","data":{"id":0,"name":"arrify@^2.0.1"}} {"type":"activityTick","data":{"id":0,"name":"case@^1.6.3"}} {"type":"activityTick","data":{"id":0,"name":"emoji-regex@^9.2.0"}} {"type":"activityEnd","data":{"id":0}} {"type":"progressStart","data":{"id":0,"total":327}} {"type":"progressTick","data":{"id":0,"current":1}} {"type":"progressTick","data":{"id":0,"current":2}} {"type":"progressTick","data":{"id":0,"current":3}} {"type":"progressTick","data":{"id":0,"current":4}} {"type":"progressTick","data":{"id":0,"current":5}} {"type":"progressFinish","data":{"id":0}} {"type":"info","data":""awesome-lint@0.18.0" has binaries:"} {"type":"list","data":{"type":"bins-awesome-lint","items":["awesome-lint"]}}
$ yarn global list --depth 0 yarn global v1.22.19 info "awesome-lint@0.18.0" has binaries: - awesome-lint β¨ Done in 0.13s.
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
Yarn emits its
--jsonoutput as a stream of one JSON object per line (the sample below elides theinfocolor-legend object; the human-readable transcript further down shows it):$ yarn --json outdated --cwd ~/.config/yarn/global {"type":"warning","data":"package.json: No license field"} {"type":"table","data":{"head":["Package","Current","Wanted","Latest","Package Type","URL"],"body":[["markdown","0.4.0","0.4.0","0.5.0","dependencies","git://github.com/evilstreak/markdown-js.git"]]}}
$ yarn outdated --cwd ~/.config/yarn/global yarn outdated v1.22.19 warning package.json: No license field info Color legend : "<red>" : Major Update backward-incompatible updates "<yellow>" : Minor Update backward-compatible features "<green>" : Patch Update backward-compatible bug fixes Package Current Wanted Latest Package Type URL markdown 0.4.0 0.4.0 0.5.0 dependencies git://github.com/.../md-js.git β¨ Done in 0.95s.
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Warning
Yarn maintainers have decided to not implement a dedicated search command.
Search is simulated by a direct call to
yarn info, and as a result only works for exact match.$ yarn --json info python | jq { "type": "inspect", "data": { "name": "python", "description": "Interact with python child process", "dist-tags": { "latest": "0.0.4" }, "versions": [ "0.0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4" ], "maintainers": [ { "name": "drderidder", "email": "drderidder@gmail.com" } ], "time": { "modified": "2017-09-16T05:26:13.151Z", "created": "2011-07-11T01:59:04.362Z", "0.0.0": "2011-07-11T01:59:05.137Z", "0.0.1": "2011-07-17T05:23:33.166Z", "0.0.2": "2011-07-20T03:42:50.379Z", "0.0.3": "2014-06-08T00:39:08.562Z", "0.0.4": "2015-01-25T02:48:07.820Z" }, "author": { "name": "Darren DeRidder" }, "repository": { "type": "git", "url": "git://github.com/73rhodes/node-python.git" }, "homepage": "https://github.com/73rhodes/node-python", "bugs": { "url": "https://github.com/73rhodes/node-python/issues" }, "readmeFilename": "README.md", "users": { "dewang-mistry": true, "goliatone": true, "sapanbhuta": true, "aditcmarix": true, "imlucas": true, "heyderpd": true, "ukuli": true, "chbardel": true, "asaupup": true, "nuwaio": true }, "version": "0.0.4", "main": "./lib/python.js", "engines": { "node": ">= 0.4.1" }, "gitHead": "69754aaa57658193916a1bf5fc391198098f74f6", "scripts": {}, "dist": { "shasum": "3094e898ef17a33aa9c3e973b3848a38e47d1818", "tarball": "https://registry.npmjs.org/python/-/python-1.tgz" }, "directories": {} } }
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ yarn --silent global add awesome-lint yarn global v1.22.19 [1/4] π Resolving packages... [2/4] π Fetching packages... [3/4] π Linking dependencies... [4/4] π¨ Building fresh packages... success Installed "awesome-lint@0.18.0" with binaries: - awesome-lint β¨ Done in 16.15s.
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ yarn --silent global upgrade --latest yarn global v1.22.19 [1/4] π Resolving packages... [2/4] π Fetching packages... [3/4] π Linking dependencies... [4/4] π¨ Rebuilding all packages... success Saved lockfile. success Saved 271 new dependencies. info Direct dependencies ββ awesome-lint@0.18.0 ββ markdown@0.5.0 info All dependencies ββ @babel/code-frame@7.18.6 ββ @babel/helper-validator-identifier@7.18.6 ββ @nodelib/fs.scandir@2.1.5 ββ array-to-sentence@1.1.0 ββ array-union@2.1.0 ββ awesome-lint@0.18.0 ββ fs.realpath@1.0.0 (...) ββ zwitch@1.0.5 β¨ Done in 19.89s.
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ yarn --silent global upgrade markdown --latest yarn global v1.22.19 [1/4] π Resolving packages... [2/4] π Fetching packages... [3/4] π Linking dependencies... [4/4] π¨ Rebuilding all packages... success Saved lockfile. success Saved 2 new dependencies. info Direct dependencies ββ markdown@0.5.0 info All dependencies ββ markdown@0.5.0 ββ nopt@2.1.2 β¨ Done in 1.77s.
- class meta_package_manager.managers.yarn.YarnBerry[source]ΒΆ
Bases:
YarnYarn Berry, the
2.xand later line.mpm claims this class for any
yarnbinary reporting a2.xor newer version.Warning
Yarn Berry removed the
yarn globalcommand family entirely: it has no notion of globally installed packages. Onlysearchis available, whileinstalled,outdated,install,upgradeandremoveare all unsupported.Note
searchis simulated withyarn npm infoand only resolves exact package names.Initialize
cli_errorslist.- id: str = 'yarn-berry'ΒΆ
Package managerβs ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as theyβre used as feature flags for the mpm CLI.
- name: str = 'Yarn Berry'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- requirement: str | None = '>=2.0.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- cli_names: tuple[str, ...] = ('yarn',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
Warning
Search is simulated by a direct call to
yarn npm info, and as a result only works for exact match.$ yarn npm info python --json | jq { "name": "python", "description": "Interact with python child process", "dist-tags": { "latest": "0.0.4" }, "versions": [ "0.0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4" ], "version": "0.0.4", (...) }
meta_package_manager.managers.zypper moduleΒΆ
- class meta_package_manager.managers.zypper.Zypper[source]ΒΆ
Bases:
PackageManageropenSUSEβs package manager.
mpmdrives zypper in XML mode (--xmlout) and parses the result withxmltodict: the most stable machine-readable output zypper offers. Every call is pinned with--no-colorand--no-abbrev(untruncated columns),--non-interactivefor unattended runs, and--no-cd --no-refreshso it never touches removable media or auto-refreshes metadata (mpmrefreshes explicitly throughsync).Note
Both
installedandsearchrunsearch --details --type package:--detailsis the only mode exposing versions, but it returns one row per source package, architecture and past release.mpmdropsother-versionrows and keeps the highest edition per package name to collapse those duplicates.Documentation:
https://documentation.suse.com/smart/systems-management/html/concept-zypper/index.html
https://wiki.archlinux.org/title/Pacman/Rosetta (command equivalences)
Initialize
cli_errorslist.- name: str = 'openSUSE Zypper'ΒΆ
Return package managerβs common name.
Default value is based on class name.
- homepage_url: str | None = 'https://en.opensuse.org/Portal:Zypper'ΒΆ
Home page of the project, only used in documentation for reference.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solaris', name='Solaris'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), Platform(id='tumbleweed', name='openSUSE Tumbleweed'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})ΒΆ
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a frozenset of
Platforminstances at instantiation.
- default_sudo: bool = TrueΒΆ
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, β¦) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- requirement: str | None = '>=1.14.0'ΒΆ
Version requirement specifier.
Supports a comma-separated range of constraints (e.g.
">=1.20.0,<2.0.0"). A bare version string like"1.20.0"is treated as>=1.20.0.Parsed by
meta_package_manager.version.VersionRange.Defaults to
None, which deactivates version check entirely.
- pre_args: tuple[str, ...] = ('--no-color', '--no-abbrev', '--non-interactive', '--no-cd', '--no-refresh')ΒΆ
- version_regexes: tuple[str, ...] = ('zypper\\s+(?P<version>\\S+)',)ΒΆ
$ zypper --version zypper 1.14.11
- property installed: Iterator[Package]ΒΆ
Fetch installed packages.
$ zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh --xmlout search --details --type package --installed-only
- property outdated: Iterator[Package]ΒΆ
Fetch outdated packages.
$ zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh --xmlout list-updates <?xml version='1.0'?> <stream> <message type="info">Loading repository data...</message> <message type="info">Reading installed packages...</message> <update-status version="0.6"> <update-list> <update name="git" kind="package" edition="2.34.1-10.9.1" edition-old="2.26.2-3.34.1" arch="x86_64"> <summary>Fast, scalable revision control system</summary> <description> Git is a fast, scalable, distributed revision control system. </description> <license/> <source url="http://download.opensuse.org/updata/leap/15.3/sle" alias="repo-sle-update"/> </update> <update name="vim" kind="package" edition="9.0.1234-1.1" edition-old="8.2.4956-1.1" arch="x86_64"> <summary>Vi IMproved text editor</summary> <description> Highly configurable text editor. </description> <license/> <source url="http://download.opensuse.org/update/leap/15.3/sle" alias="repo-sle-update"/> </update> </update-list> </update-status> </stream>
- search(query, extended, exact)[source]ΒΆ
Fetch matching packages.
$ zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh --xmlout search --details --type package kopete
$ zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh --xmlout search --details --type package --search-description kopete
$ zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh --xmlout search --details --type package --match-exact kopete
$ zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh --xmlout search --details --type package --search-description --match-exact kopete
- install(package_id, version=None)[source]ΒΆ
Install one package.
$ sudo zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh install kopete
- Return type:
- upgrade_all_cli()[source]ΒΆ
Generates the CLI to upgrade all outdated packages.
$ sudo zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh update
- upgrade_one_cli(package_id, version=None)[source]ΒΆ
Generates the CLI to upgrade the provided package.
$ sudo zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh update kopete
- remove(package_id)[source]ΒΆ
Remove one package.
$ sudo zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh remove kopete
- Return type:
- sync()[source]ΒΆ
Sync package metadata.
$ sudo zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh refresh
- Return type:
- cleanup()[source]ΒΆ
Removes things we donβt need anymore.
$ sudo zypper --no-color --no-abbrev --non-interactive --no-cd --no-refresh clean
- Return type:
- cli_names: tuple[str, ...] = ('zypper',)ΒΆ
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this propertyβs value is derived from the managerβs ID (see the
MetaPackageManager.__init__method above).