meta_package_manager.managers.pacstall module

class meta_package_manager.managers.pacstall.Pacstall[source]

Bases: PackageManager

AUR-inspired, source-based package manager for Ubuntu and other Linux distributions.

Pacstall builds packages from “pacscripts” and installs the results as .deb archives through dpkg. mpm forces NO_COLOR and DISABLE_PROMPTS so output is uncolored and every call stays non-interactive.

pacstall self-escalates: every privileged subcommand re-execs the script through sudo pacstall (its elevate() function), and its documented invocation is unprefixed (pacstall -I foo). mpm therefore never wraps it and marks it internal_sudo instead: a warm sudo credential cache is kept alive for its mid-run re-exec, and the hidden-prompt watchdog covers the cold-cache case.

Note

Listing installed packages is a two-step probe: piped --list prints bare names with no versions, so mpm follows each with a --cache-info <pkg> version call to recover its version.

Note

--search matches names only and reports no versions. There is no per-package upgrade verb either, so upgrading one package reinstalls it through --install.

Initialize cli_errors list.

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='almalinux', name='AlmaLinux'), 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='endeavouros', name='EndeavourOS'), 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='pikaos', name='PikaOS'), 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='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 Platform instances at instantiation.

internal_sudo: bool = True

Marks a manager whose CLI invokes sudo itself mid-run.

Homebrew cask runs it from installer artifacts, fink re-execs its root commands through it, and the AUR helpers call sudo pacman for their install steps. mpm never wraps such a manager’s commands: either none of its operations carry a build_cli(..., sudo=True) marker (cask, fink), or its default_sudo = False policy leaves the markers it inherits unescalated (the AUR helpers). Running the tool under sudo is often forbidden outright (brew refuses root, makepkg refuses to build). Consumed by prime_sudo(), whose opportunistic probe keeps an already-warm credential cache alive for these internal escalations, and by the silent-call notice in run(), which flags a possibly-hidden password prompt on a cold cache.

Forcing sudo = true on such a manager (config key or --sudo) still never wraps its commands, but does promote it into the up-front prompt path of prime_sudo().

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 --list outputs bare package names without versions. A follow-up pacstall --cache-info <pkg> version call 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
Return type:

Iterator[Package]

install(package_id, version=None)[source]

Install one package.

$ pacstall --install neofetch
Return type:

str

upgrade_all_cli()[source]

Generates the CLI to upgrade all packages.

$ pacstall --upgrade
Return type:

tuple[str, ...]

upgrade_one_cli(package_id, version=None)[source]

Generates the CLI to upgrade one package by reinstalling it.

$ pacstall --install neofetch
Return type:

tuple[str, ...]

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 python or python3.

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.

remove(package_id)[source]

Remove one package.

$ pacstall --remove neofetch
Return type:

str

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.

sync()[source]

Sync package metadata from remote repositories.

$ pacstall --update
Return type:

None