← Back to context

Comment by plq

3 years ago

Arch is not bad but last I looked it didn't have what Portage calls "slotting" ie the ability to have multiple versions of the same package installed side-by-side. It's especially helpful when eg. you are upgrading postgres and need multiple versions operational for the cross-version dump/restore.

How would that work on arch?

As a Gentoo and Arch user, SLOTs are really overstated as a feature; a near-identical result can be produced by using multiple package names, possibly combined with a "provides" type feature. As a concrete example, Gentoo has fuse:2 and fuse:3 whereas Arch has fuse2 and fuse3. Searching for sys-fs/fuse:* in (what used to be called) gentoo-x86 yields only lxd, so the SLOT is providing little value here.

Categories are a similar issue in Portage: emerge graphviz asks if I want dev-python/graphviz or media-gfx/graphviz, but obviously the default should be the latter. Arch instead has python-graphviz and graphviz, which is much better design. Categories fix naming collisions in exactly the wrong way: dumping it on the user and giving no sensible default.

For PostgreSQL specifically, Arch provides postgresql and postgresql-old-upgrade, so as long as you don't wait years to upgrade your PostgreSQL, you'll be fine. It's a reduction in flexibility but brings with it a significant reduction in complexity: nobody can properly maintain half a dozen Postgres versions anyways, so just keep the latest two around.

  • I'll agree that slots are useful... for whatever reason on arm, uboot and ATF won't compile with the latest binutils and gcc. Slotting lets me switch back to the older stuff to build new firmware, while keeping the rest of the system current.

    • Isn't nix basically an entire distro based around the idea of slotting? I've never dug into it but it seems an interesting concept, at least.

      1 reply →

Arch does this with certain packages, usually libraries, by appending the version to the package name.

And of course the bigger things...like python2 vs python, and the multiple openjdk stuff.

There is no built-in support that I know of. The official repos usually only contain the latest version of each package (Postgres being an exception).

However, every time I've needed older library versions I've found that somebody already uploaded a suitable PKGBUILD to AUR (Arch's user-contributed build-from-source system).

For instance, the current version of PHP in Arch is 8.2.6. If you need an older version there is php81, php80, php74, etc. available in AUR. If it didn't exist, just take the PKGBUILD for the current version, modify it to build the older version, then upload it to AUR so other people don't have to re-do the work. It works well in practice.

Never used Arch, but I'd be surprised if Arch doesn't support it. How any modern distribution can survive without some semblance of slotting befuddles me.