One command. Every package manager.
Remembering the exact syntax to install a package across different operating systems (apt, pacman, brew, apk) is a frustrating and error-prone chore. pkgwrap solves this context-switching fatigue by giving you one universal command that automatically detects your OS and translates standard operations into native syntax.
- Zero Configuration: Automatically detects your OS and native package manager out of the box—no setup required.
- Muscle Memory Saver: Stop pausing to remember if it's
pacman -S,apt install, ordnf install. Just typepkw install. - Smart Permissions: Automatically prefixes commands with
sudowhen required and prompts for confirmation, gracefully skipping if you're already running asroot. - Ultra Lightweight: No heavy dependencies, network API calls, or bloated background services. It simply wraps your local package manager safely.
Why not just memorize apt/pkg/pacman?
If you only ever use a single operating system, you probably should! But if you are a developer, sysadmin, or homelabber who frequently jumps between a Debian VPS, a macOS workstation, an Alpine Docker container, or a Termux shell on your phone, you know the pain of typing apt install on an Arch machine. pkgwrap eliminates that friction entirely
pkgwrap operates on a clean, layered design. Input is processed at the CLI layer and passed to a detector that intelligently identifies the host system. The detector requests the appropriate backend from a registry, and the selected backend implementation handles the translation. Finally, the base class manages root privileges and user confirmation before executing the native process safely.
User runs `pkgwrap install nmap`
|
v
[cli.py] -- argparse, flags (-y, --backend)
|
v
[detector.py] -- checks PREFIX/TERMUX_VERSION, platform.system(),
then shutil.which() in priority order
|
v
[backends/__init__.py registry] -- maps backend name to class
|
v
[Backend subclass] (apt/pkg/pacman/dnf/apk/brew/zypper/xbps/nix/
eopkg/freebsd)
|
v
[base.py _run_command()] -- sudo/root detection, confirmation,
subprocess.run(shell=False)
|
v
Native package manager executes
| OS/Distro | Backend | Package Manager Command | Status |
|---|---|---|---|
| Debian/Ubuntu | apt | apt |
✅ Supported |
| Termux/Android | pkg | pkg |
✅ Supported |
| Arch Linux | pacman | pacman |
✅ Supported |
| Fedora | dnf | dnf |
✅ Supported |
| Alpine | apk | apk |
✅ Supported |
| macOS | brew | brew |
✅ Supported |
| openSUSE | zypper | zypper |
✅ Supported |
| Void Linux | xbps | xbps |
✅ Supported |
| NixOS | nix | nix |
✅ Supported |
| Solus | eopkg | eopkg |
✅ Supported |
| FreeBSD | pkg | pkg |
✅ Supported |
- Note: FreeBSD and Termux are automatically distinguished even though both can expose a pkg command, via strict OS/environment detection.
pip install pkgwrap-lokeshcurl -fsSL https://raw.githubusercontent.com/trmxvibs/pkgwrap/main/install.sh | bashgit clone https://github.com/trmxvibs/pkgwrap.git
cd pkgwrap
bash install.sh --sourcepkgwrap install <package>
pkgwrap remove <package>
pkgwrap update
pkgwrap search <package>
pkw install <package> # short alias, identical behavior
pkgwrap install <package> -y # skip confirmationNote: If you are already running as root (or use sudo directly), confirmation prompts are skipped automatically. Use the
--backendflag to see which package manager pkgwrap has detected for your system.
\$ pkgwrap install cowsay
ℹ The command 'sudo apt install -y cowsay' requires administrative privileges (sudo).
? Do you want to proceed with sudo? (y/N) y
→ Running: sudo apt install -y cowsay
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
cowsay
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
...
✔ Successfully finished installation process for 'cowsay'.
Contributions, issues, and feature requests are always welcome! Adding support for a new package manager is as simple as creating a new file in the backends/ directory that implements the Backend interface. Feel free to open a ticket or submit a PR on our issues page.
- Core universal wrapper (11 backends)
- Automatic sudo/root detection
- Termux-aware detection
- Windows support (winget/choco)
- Package name mapping across backends
- Shell completion (bash/zsh)
MIT — see LICENSE file for details.
Made with ❤️ for the terminal by trmxvibs