Upac — modular linux package management

Upac — a modular package management library for Linux with OSTree integration

GitHub - justpav05/upac: Package manager for installing any type of package in Linux, as well as registering binary file rollbacks based on OSTree, written in Rust and Zig · GitHub | v0.1.4 | LGPL-3.0

Upac is a package management library written in Zig, designed to be embedded into any package manager through a stable C ABI. The CLI frontend is written in Rust and loads libupac.so dynamically at runtime.

What’s interesting about the design

The core idea is that the library imposes zero policy on how packages are fetched or what format they come in. Format-specific logic lives in separate backend shared libraries (libupac-alpm.so, libupac-rpm.so, etc.) — each independently handles unpacking, checksum verification, and metadata parsing. Adding support for a new package format means writing a new .so, the core never changes.

The C ABI boundary was a deliberate design decision: all strings cross as { ptr, len } pairs instead of null-terminated C strings. This makes FFI from Rust, Python, or any other language significantly less painful since Zig slices map naturally to fat pointers.
OSTree integration handles rollbacks — the system state can be reverted to any previous commit, which matters for immutable-style setups.

Why Zig + Rust

Zig handles the low-level library work well: C interop without overhead, precise control over memory layout at the ABI boundary, and comptime for backend dispatch. Rust handles the CLI because ergonomics matter there — argument parsing, formatted output, error display.

Supported Zig versions: ≥ 0.16.0

AI / LLM usage: Claude (Anthropic) was used during development for architectural discussions, design decisions, and code assistance. The project is not vibe-coded — all design decisions were made by the author.

2 Likes

I like the idea of a unified package management system, especially as the a drop-in backend for other tooling, install scripts, etc.

I did have one question that I feel is important, but also perhaps outside the scope of this project: as Arch user (btw), I glanced around and didn’t see a way for it to handle AUR packages. I did see in the README that it can interact with makepkg, but not a way to fetch the PKGBUILD from the AUR and streamline the build/install. Would this be something you would consider adding, or does it already have this feature and I just didn’t see it?

So far, we have an active development process, so the foundation is still actively changing there. So far, there are not even repositories and dependencies, plus there is no categorization and other features that I would like to implement.

Of course, in the future I will implement an automatic clean build in a separate root with the installation of dependencies there, as well as the management of flatpack packages and other things, but for now I’m just looking for people who would help me in development.