pkgx - Universal Package Manager
A cross-platform wrapper for various system package managers. pkgx automatically detects your system's package manager and provides a unified interface for common package management operations.
Supported Package Managers
- apt (Debian/Ubuntu)
- dnf (Fedora/RHEL 8+)
- yum (RHEL/CentOS/Fedora)
- microdnf (Minimal container environments)
- zypper (openSUSE)
- apk (Alpine Linux)
- brew (Homebrew - macOS/Linux)
- choco (Chocolatey - Windows)
Installation
Install with UV
# Install from current directory
uvx --from . pkgx --help
# Or install persistently
uv tool install .
Install from PyPI (once published)
# Install and run temporarily
uvx pkgx install git
# Install persistently
uv tool install pkgx
Usage
Basic Commands
# Install packages
pkgx install git vim curl
# Remove packages
pkgx remove old-package
# Update package lists
pkgx update
# Upgrade all packages
pkgx upgrade
# Upgrade specific packages
pkgx upgrade git vim
# Search for packages
pkgx search firefox
# List available package managers
pkgx list-managers
# Show version
pkgx version
Advanced Options
# Force a specific package manager
pkgx install git --manager apt
pkgx install git -m brew
# Dry run (show what would be executed)
pkgx install git --dry-run
pkgx upgrade --dry-run -n
How It Works
- Auto-detection: pkgx automatically detects available package managers on your system
- Priority Selection: Uses platform-specific preferences (e.g.,
apton Debian/Ubuntu,dnfon Fedora) - Unified Interface: Translates commands to the appropriate syntax for each package manager
- Cross-platform: Works on Linux, macOS, and Windows
Examples
Cross-platform Package Installation
# This command works on any supported system:
pkgx install git
# On Ubuntu/Debian, runs: apt install -y git
# On Fedora, runs: dnf install -y git
# On macOS with Homebrew, runs: brew install git
# On Windows with Chocolatey, runs: choco install git -y
Checking Available Managers
$ pkgx list-managers
Available package managers:
apt - apt ✓ available (auto-detected)
dnf - dnf ✗ not available
microdnf - microdnf ✗ not available
yum - yum ✗ not available
zypper - zypper ✗ not available
apk - apk ✗ not available
brew - brew ✓ available
chocolatey - choco ✗ not available
Auto-detected package manager: apt
Using Specific Managers
# Force use of a specific package manager
pkgx install nodejs --manager brew
pkgx search python --manager apt
Development
Project Structure
pkgx/
├── pyproject.toml # Package configuration
├── README.md # This file
└── pkgx/
├── __init__.py # Package metadata
├── cli.py # Main CLI interface
└── managers.py # Package manager implementations
Testing Locally
# Navigate to the pkgx directory
cd pkgx
# Test the tool without installing
uvx --from . pkgx list-managers
# Test specific commands with dry-run
uvx --from . pkgx install git --dry-run
Building and Publishing
# Build the package
uv build
# Publish to PyPI (requires configuration)
uv publish
Contributing
- Add support for new package managers by creating a new class in
managers.py - Extend the auto-detection logic in
detect_package_manager() - Update the documentation and examples
License
MIT License - see the LICENSE file for details.
Metadata
Release files for pkgx 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pkgx-0.1.1.tar.gz | 7.3 kB | Without provenance | Details for pkgx-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pkgx-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pkgx-0.1.1-py3-none-any.whl |
Total release size: 14.1 kB
Release files / pkgx-0.1.1.tar.gz
| Download URL | pkgx-0.1.1.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02e77ec00d5c9ddc8888c8d0e5f840734687ba56964cdf91b95b7d73160cafb4
|
|
BLAKE2b-256 checksum How to use checksums |
0797a314b468bef42f93037b84e2d228d48b6eec48e4c8151316dd699e9e91f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Release files / pkgx-0.1.1-py3-none-any.whl
| Download URL | pkgx-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d97cc499835cc24a89d0dd541d10c32041256cb59877cdfd7b1eb646c5a2d0be
|
|
BLAKE2b-256 checksum How to use checksums |
7fa677f81511c39db8a4d42fe3758a0e19a32e55aa5ebb460c04880582d33a42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Security for pkgx 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.