Why Linux applications are hard to distribute
Summary
On Hackaday, Maya Posch picks up the report by Noam Lewis, author of the terminal editor Fresh, who published his program through practically every Linux packaging route. Each route reaches only some users and brings its own problems, from slow AppImage start-up to packages without automatic updates. Lewis therefore relies in future on a program statically built with musl that updates itself.
One channel per user group
Fresh is released via crates.io and cargo-binstall, as AppImage and Flatpak, as deb and rpm, in the AUR in two variants, for nix, mise, Homebrew on Linux, npm, Terra and Gentoo GURU, and as a tar archive. After every release Lewis wonders which of these channels will break this time.
Flatpak is a poor fit because its sandbox is meant for desktop programs, while a terminal editor should work freely across the system and the network. AppImage starts slowly because it mounts its squashfs via FUSE on every call. Built against a newer glibc, the packages do not run on distributions two or three years old.
Why official packages are not easy
An official Debian package would require all Rust dependencies to exist as Debian packages too; the policy does not allow simply bundling their sources. Without inclusion in the official repositories, deb and rpm users get no updates through apt or dnf.
Side routes are fragile too: the mise route failed when GitHub changed the certificate of its attestation service and mise had pinned an outdated trust root. The AUR was temporarily read-only after security incidents, so Fresh missed releases.
Ideas
- Many packaging routes mean many places where a release can fail.
- Sandbox formats suit tools that need to reach the whole system poorly.
- Dynamically linked programs depend on the glibc version of the target distribution.
- Official distribution packages require packages for all dependencies as well.
- Packages outside the distribution repositories receive no automatic updates.
- A static musl program with its own updater sidesteps the variety of packages.
Insights
- Distribution policies protect users and at the same time burden small projects.
- A built-in updater shifts responsibility that the distribution normally carries onto the author.
- Portability on Linux fails more often because of runtime libraries than because of the package format.
Quotes
- I just want to GIVE AWAY MY SOFTWARE. (Noam Lewis)
Facts
- Fresh is distributed through more than ten packaging channels.
- According to Lewis, the download is about 12 MB and extracts to about 35 MB.
- AppImage mounts its squashfs via FUSE on every start.
- Debian requires packaged dependencies for Rust programs instead of bundled sources.
References
- Hackaday: The Agony of Packaging Linux Apps
- Noam Lewis: I hate packaging my software for Linux (Fresh blog)
Critique
- Lewis does not describe how the new self-updater verifies and signs downloads; that is exactly what decides whether the route is safer than npm.
Remarks
- Hackaday ends by asking whether a solution can be bad if it works for users; the answer depends on who ships security updates in future.
Recommendations
- Build command-line tools statically if they need to run on old and new distributions.
- Before shipping your own updater, check signatures and a way to roll back.
- Install programs from third-party sources deliberately and note how they are updated.
Found a mistake or have something to add? Get in touch.
Links to the original source and the Web Archive open in a new tab.