<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ChirallyActive</title>
    <description>The latest articles on DEV Community by ChirallyActive (@chirallyactive).</description>
    <link>https://dev.to/chirallyactive</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4006292%2Fc77599fb-d73d-48fa-bd30-300a99a6fe21.jpg</url>
      <title>DEV Community: ChirallyActive</title>
      <link>https://dev.to/chirallyactive</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chirallyactive"/>
    <language>en</language>
    <item>
      <title>I built my own package manager in Rust while building a Linux distro from scratch</title>
      <dc:creator>ChirallyActive</dc:creator>
      <pubDate>Sun, 28 Jun 2026 09:21:21 +0000</pubDate>
      <link>https://dev.to/chirallyactive/i-built-my-own-package-manager-in-rust-while-building-a-linux-distro-from-scratch-4hfm</link>
      <guid>https://dev.to/chirallyactive/i-built-my-own-package-manager-in-rust-while-building-a-linux-distro-from-scratch-4hfm</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;About halfway through I ran into a problem: &lt;strong&gt;there's no package manager for LFS systems.&lt;/strong&gt; You're just supposed to compile everything manually forever.&lt;/p&gt;

&lt;p&gt;So I built one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Chiral?
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;The key idea: instead of being tied to one distro's repos, Chiral uses a &lt;strong&gt;3-way fallback chain&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Your own GitHub packages/ repo
         ↓ not found?
2. Debian stable repos
         ↓ not found?
3. Arch Linux repos
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a package exists anywhere in that chain, Chiral finds it and installs it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install in one line
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; https://github.com/Amaterus1125/Chiral-CrossDistro-Package-Manager/releases/latest/download/chiral &lt;span class="nt"&gt;-o&lt;/span&gt; chiral
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x chiral
&lt;span class="nb"&gt;sudo mv &lt;/span&gt;chiral /usr/local/bin/chiral
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;100% static musl binary. No Rust, no dependencies, runs on any Linux including a fresh LFS system with nothing installed.&lt;/p&gt;

&lt;h2&gt;
  
  
  How dependency resolution works
&lt;/h2&gt;

&lt;p&gt;When you run &lt;code&gt;chiral install gtk3&lt;/code&gt;, it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Queries the Arch Linux API for gtk3's full dependency list&lt;/li&gt;
&lt;li&gt;Walks the entire tree recursively using BFS&lt;/li&gt;
&lt;li&gt;Checks each dep against your system before downloading&lt;/li&gt;
&lt;li&gt;Builds a topological install order so deepest deps go first&lt;/li&gt;
&lt;li&gt;Installs everything in order, gtk3 last
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gtk3
 ├── glib2       ← installed 1st
 ├── cairo
 │    └── pixman ← installed before cairo
 ├── pango
 └── gdk-pixbuf2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Commands
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chiral &lt;span class="nb"&gt;install&lt;/span&gt; &amp;lt;package&amp;gt;   &lt;span class="c"&gt;# install with full dep resolution&lt;/span&gt;
chiral remove  &amp;lt;package&amp;gt;   &lt;span class="c"&gt;# clean remove — tracks every file&lt;/span&gt;
chiral update  &amp;lt;package&amp;gt;   &lt;span class="c"&gt;# update one package&lt;/span&gt;
chiral upgrade             &lt;span class="c"&gt;# update everything&lt;/span&gt;
chiral search  &amp;lt;query&amp;gt;     &lt;span class="c"&gt;# search available packages&lt;/span&gt;
chiral list                &lt;span class="c"&gt;# list installed packages&lt;/span&gt;
chiral info    &amp;lt;package&amp;gt;   &lt;span class="c"&gt;# version, source, files&lt;/span&gt;
chiral deps    &amp;lt;package&amp;gt;   &lt;span class="c"&gt;# dry run — see what would install&lt;/span&gt;
chiral self-update         &lt;span class="c"&gt;# update chiral itself&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;chiral info&lt;/code&gt; even works on packages not installed by Chiral:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chiral info rust
&lt;span class="c"&gt;# Package : rust&lt;/span&gt;
&lt;span class="c"&gt;# Status  : not managed by chiral&lt;/span&gt;
&lt;span class="c"&gt;# Version : 1.93.1&lt;/span&gt;
&lt;span class="c"&gt;# Source  : rustup (installed outside chiral)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The technical bits
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Dependency resolution&lt;/strong&gt; uses BFS to walk the full tree, then Kahn's algorithm for topological sort. Circular deps are detected and broken automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File tracking DB&lt;/strong&gt; records every installed file path so &lt;code&gt;chiral remove&lt;/code&gt; is perfectly clean:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;[&lt;span class="n"&gt;steam&lt;/span&gt;=&lt;span class="m"&gt;3&lt;/span&gt;.&lt;span class="m"&gt;5&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;-&lt;span class="m"&gt;1&lt;/span&gt;|&lt;span class="n"&gt;arch&lt;/span&gt;]
/&lt;span class="n"&gt;usr&lt;/span&gt;/&lt;span class="n"&gt;local&lt;/span&gt;/&lt;span class="n"&gt;bin&lt;/span&gt;/&lt;span class="n"&gt;steam&lt;/span&gt;
/&lt;span class="n"&gt;usr&lt;/span&gt;/&lt;span class="n"&gt;local&lt;/span&gt;/&lt;span class="n"&gt;lib&lt;/span&gt;/&lt;span class="n"&gt;steam&lt;/span&gt;/...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Self-updating&lt;/strong&gt; — &lt;code&gt;sudo chiral self-update&lt;/code&gt; hits the GitHub releases API, compares versions, downloads the new static binary and replaces itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Auto-sync&lt;/strong&gt; — 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root vs user mode&lt;/strong&gt; — runs system-wide as root (&lt;code&gt;/usr/local&lt;/code&gt;) or per-user as a regular user (&lt;code&gt;~/.local&lt;/code&gt;). No configuration needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I built this
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Orphan detection (&lt;code&gt;chiral autoremove&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Conflict detection&lt;/li&gt;
&lt;li&gt;KDE support on my custom distro&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;GitHub: &lt;a href="https://github.com/Amaterus1125/Chiral-CrossDistro-Package-Manager" rel="noopener noreferrer"&gt;Chiral Package Manager&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>linux</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
