Pkgz is a fast, extensible CLI tool written in Crystal π for managing software packages across multiple Linux distributions.
- β Install, remove, update and search apps
- π Interactive source selection if app is available in multiple sources
- π Automatically uses
doasorsudofor privilege elevation - π¦ Supports:
- Apt / Nala (Debian/Ubuntu)
- Flatpak
- Pacman (Arch)
- Paru (AUR helper)
- Yay (AUR helper)
- DNF (Fedora/RHEL)
- APK (Alpine)
- Pacstall
- Zypper (openSUSE)
- XBPS (Void)
- Nix (
Untested) - FreeBSD & FreeBSD Ports (
Untested) - OpenBSD & OpenBSD Ports (
Untested)
- βοΈ Configurable via
~/.config/pkgz/config.toml - π± Extensible to support other package managers
To use pkgz, youβll need the following:
-
Privilege elevation:
Eithersudoordoasmust be installed. -
At least one supported package manager:
Linux:apt,nala,flatpak,pacman,paru,yay,dnf,zypper,apk,xbps,nixorpacstall
BSD:FreeBSD pkg,FreeBSD Ports,OpenBSD pkg,OpenBSD Ports -
Crystal compiler:
Only needed if you're building from source.
(Prebuilt binaries donβt require Crystal.)
Create or edit ~/.config/pkgz/config.toml:
[sources]
apt = true
nala = false
flatpak = true
paru = false
yay = false
pacman = false
dnf = false
pacstall = true
zypper = false
xbps = false
nix = false
freebsd = false
freebsd_ports = false
openbsd = false
openbsd_ports = false
[elevator]
command = "sudo" # or "doas"You only need to add the sources you will use and set them to true
Also you Must have an elevator set, either sudo or doas
You can install the latest prebuilt binary directly with:
curl -sS https://raw.githubusercontent.com/roguehashrate/pkgz/main/install.sh | bashThis installs pkgz to ~/.local/bin.
Make sure ~/.local/bin is in your $PATH.
To verify the integrity of the binary:
curl -LO https://github.com/roguehashrate/pkgz/releases/download/v0.1.9/pkgz
curl -LO https://github.com/roguehashrate/pkgz/releases/download/v0.1.9/pkgz.sha256
sha256sum -c pkgz.sha256git clone https://github.com/roguehashrate/pkgz
cd pkgz
crystal build src/pkgz.cr --release -o pkgz
mv pkgz ~/.local/bin/Download from Releases:
mv pkgz ~/.local/bin
chmod +x ~/.local/bin/pkgzwget https://github.com/roguehashrate/pkgz/releases/download/v0.1.9/pkgz-0.1.9.tar.gz
wget https://github.com/roguehashrate/pkgz/releases/download/v0.1.9/pkgz-0.1.9.tar.gz.sha256
sha256sum -c pkgz-0.1.9.tar.gz.sha256
tar -xvf pkgz-0.1.9.tar.gz
cd pkgz
chmod +x install.sh
./install.shMake sure ~/.local/bin is in your PATH.
pkgz <install|remove|update|search|clean|info|--version> [app-name]Examples:
pkgz install gimp
pkgz remove gimp
pkgz clean
pkgz info gimp
pkgz update
pkgz --versionSample output:
$ pkgz install gimp
π Searching for 'gimp' in sources...
π¦ Found 'gimp' in multiple sources:
1. APT
2. Flatpak
Which one would you like to use? [1-2]: 2
π Installing with Flatpak...
- Automatically detects and uses
doasorsudo. - Privileged commands are run with the configured elevator command.
To add support for a new package manager:
- Subclass
Pkgz::Source - Implement:
nameavailable?(app)install(app)remove(app)updatesearch(app)
- Add your source to the enabled sources list and config.
Created by roguehashrate
