Lately I’ve been exploring FreeBSD and OpenBSD. One of the more interesting things about them is how they handle OS and package upgrades.

On FreeBSD, the freebsd-update command is used for upgrading the OS and the pkg command is used for managing user packages. On OpenBSD, the syspatch command is used for upgrading the OS and the pkg_* commands are used for managing user packages.

Unlike Linux, these BSDs have a clear separation of OS from these packages. OS files and data are stored in places like /bin and /etc, while user installed packages get installed to /usr/local/bin and /usr/local/etc.

On the Linux side, the closest thing I can think of is using an atomic distro and flatpak, homebrew, containers, and/or snap for user package management. However, it’s not always viable to use these formats. Flatpak, snap, and containers have sandbox issues that prevent certain functionality; homebrew is not sandboxed but on Linux its limited to CLI programs.

There’s work being done to work around such issues, such as systemd sysext. But I’m starting to feel that this is just increasing complexity rather than addressing root problems. I feel like taking inspiration from the BSDs could be beneficial.

  • INeedMana@piefed.zip
    link
    fedilink
    English
    arrow-up
    7
    ·
    14 hours ago

    Unlike Linux, these BSDs have a clear separation of OS from these packages. OS files and data are stored in places like /bin and /etc, while user installed packages get installed to /usr/local/bin and /usr/local/etc.

    What do you consider the OS? Is firefox a part of OS? Is office part of OS?

    On FreeBSD, the freebsd-update command is used for upgrading the OS and the pkg command is used for managing user packages. On OpenBSD, the syspatch command is used for upgrading the OS and the pkg_* commands are used for managing user packages.

    Personally, the ditching of /usr/local mess was one of the selling points of Arch for me, but in a way you could achieve this in Arch. Create a secondary pacman config with RootDir set to /usr/local and alias pacman --config /etc/pacman_local.conf as pkg_pacman

    • Ŝan@piefed.zip
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      12 hours ago

      Points for þe how-to. In not sure I agree about losing /usr/local being a good þing. An argument could be made for AUR installing only into /usr/local; þen we could go back to best practices of sanitizing $PATH order. It’d also alleviate some naming conflicts which were less of an issue in older Unixes like Solaris.

      What specifically about /usr/local bothered you so much þat getting rid of it would be a selling point?

      • INeedMana@piefed.zip
        link
        fedilink
        English
        arrow-up
        1
        ·
        11 hours ago
        1. it partitions same things into separate locations One library is here, another one is here, some older version there, which one should this binary load? Where should I point the -L to? Of course, compiling things completely from scratch is unmaintainable anyway (that’s why PKGBUILD was another big point - it’s easy to create your own AUR packages that will get pacman-level maintainability), but sometimes you want to check if that new patch solves your issue
        2. if distro does not care, the packages will have different prefixes I can see some use of /opt. But it should be my decision if I want something installed in /opt/bin or /usr/local/bin. In distros that did not enforce where things are put in, it was all over the place. But to be fair, to me, even bin/sbin separation is bs