A few months ago I decided to build a Linux distribution entirely from scratch using LFS (Linux From Scratch) and BLFS. Every package — GCC, glibc, systemd, XFCE — compiled by hand. No shortcuts.
About halfway through I ran into a problem: there's no package manager for LFS systems. You're just supposed to compile everything manually forever.
So I built one.
What is Chiral?
Chiral is a cross-distro binary package manager written in Rust. It works on any Linux system — including custom LFS/BLFS distros, Arch, Debian, and anything in between.
The key idea: instead of being tied to one distro's repos, Chiral uses a 3-way fallback chain:
1. Your own GitHub packages/ repo
↓ not found?
2. Debian stable repos
↓ not found?
3. Arch Linux repos
If a package exists anywhere in that chain, Chiral finds it and installs it.
Install in one line
curl -L https://github.com/Amaterus1125/Chiral-CrossDistro-Package-Manager/releases/latest/download/chiral -o chiral
chmod +x chiral
sudo mv chiral /usr/local/bin/chiral
100% static musl binary. No Rust, no dependencies, runs on any Linux including a fresh LFS system with nothing installed.
How dependency resolution works
When you run chiral install gtk3, it:
- Queries the Arch Linux API for gtk3's full dependency list
- Walks the entire tree recursively using BFS
- Checks each dep against your system before downloading
- Builds a topological install order so deepest deps go first
- Installs everything in order, gtk3 last
gtk3
├── glib2 ← installed 1st
├── cairo
│ └── pixman ← installed before cairo
├── pango
└── gdk-pixbuf2
The smart part: before downloading anything, Chiral checks if a dep is already on your system via pacman, dpkg, pkg-config, ldconfig, PATH, rustup, and direct filesystem scanning. It works alongside existing package managers without conflicting.
Commands
chiral install <package> # install with full dep resolution
chiral remove <package> # clean remove — tracks every file
chiral update <package> # update one package
chiral upgrade # update everything
chiral search <query> # search available packages
chiral list # list installed packages
chiral info <package> # version, source, files
chiral deps <package> # dry run — see what would install
chiral self-update # update chiral itself
chiral info even works on packages not installed by Chiral:
chiral info rust
# Package : rust
# Status : not managed by chiral
# Version : 1.93.1
# Source : rustup (installed outside chiral)
The technical bits
Dependency resolution uses BFS to walk the full tree, then Kahn's algorithm for topological sort. Circular deps are detected and broken automatically.
File tracking DB records every installed file path so chiral remove is perfectly clean:
[steam=3.5.0-1|arch]
/usr/local/bin/steam
/usr/local/lib/steam/...
Self-updating — sudo chiral self-update hits the GitHub releases API, compares versions, downloads the new static binary and replaces itself.
Auto-sync — a GitHub Actions workflow runs every Sunday, checks Arch and Debian for newer versions of packages in the repo, repacks them and commits automatically. The package repo updates itself.
Root vs user mode — runs system-wide as root (/usr/local) or per-user as a regular user (~/.local). No configuration needed.
Why I built this
LFS teaches you how Linux actually works by making you build it yourself. But once you've built it, you're stuck installing everything by hand forever. There's no package manager for a system you assembled from scratch.
I wanted one. So I built it in Rust, made it work on any Linux regardless of what's installed, and gave it the ability to pull packages from three different sources so it can find almost anything.
The name comes from chirality in chemistry — molecules that are mirror images of each other. The two UI modes (Dextro and Levo) reflect this. Dextro is the default orange helix animation. Levo is a DNA sequencer animation that shows base pairs (A═T, G≡C) scrolling as packages install.
What's next
- Orphan detection (
chiral autoremove) - Conflict detection
- KDE support on my custom distro
GitHub: Chiral Package Manager
Built by one person while building a Linux distro from scratch. If you're doing LFS/BLFS or want a package manager that works everywhere, give it a try.