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.

  • AnUnusualRelic@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    4 days ago

    I think of those as BSD thoughtful and pondered, and Linux as fairly fast and maybe thoughtless (in the jouyful sense that things have to go forward). In the end BSD is definitely cleaner, but behind, and Linux is much messier but is at the front of what’s going on.

    And I’m sayin this as someone who’s worked with both systems for decades and even though I prefer Linux on the desktop or on servers, on embedded systems, where you’d need some really clean code to poke at, BSD really shines.

    Of course BSD works fine (mostly) everywhere. It’s almost as good today as it was in 2000.

  • jollyrogue@lemmy.ml
    link
    fedilink
    arrow-up
    9
    ·
    5 days ago

    There are none. Linux is a baseless system, which is its power and frustration.

    You could install Debian or Alma Linux and run pkgsrc on it to approximate a base and extra packages setup like the BSDs.

    There are parts of a tightly coupled userland forming, like iptools and systemd, but there are many things missing at the moment.

  • Eugenia@lemmy.ml
    link
    fedilink
    English
    arrow-up
    4
    ·
    5 days ago

    No, there isn’t, however, NixOS is made by ex-freebsd people, and some of the philosophy has bled through there. Have a look at it.

    • bobo@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      4 days ago

      My NixOS config works this way

      nixos-rebuild switch --upgrade for system package upgrades and config changes

      home-manager switch for user package updates and config changes

  • nyan@sh.itjust.works
    link
    fedilink
    arrow-up
    2
    ·
    4 days ago

    Gentoo will allow you to update the small set of required system packages and their dependencies separately from everything else (emerge --update system), but doing the reverse would require some pretty heavy micro-management.

  • steeznson@lemmy.world
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    4 days ago

    Alpine package manager and use of MUSL over glibc are pretty similar to a BSD. Like others have pointed out there are limits to how closely a Linux distro can match the deliberate structure of those distros given the different design philosophy

    • Leaflet@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      5 days ago

      I’m worried about complexity. Traditional Linux package management isn’t perfect. Atomic distros try to address this in various ways, including but not limited to a clear separation of OS and user packages.

      For example, on Fedora Silverblue you’re not meant to modify the base OS with rpm-ostree. You’re supposed to use flatpak and toolbox (homebrew and appimages are also options, but not preinstalled). But these have limitations that rpms do not.

      On the BSDs, this isn’t really a problem. It manages a clear OS and user package split without the sandboxing limitations. That’s not to say that sandboxing is bad, I fully support it, but when you run into the currently unfixed limitations, it’s a pain. As an example, in the snap and flatpak versions of Chromium-based browsers, you can’t use Android’s adb tools, which I used to need when using custom OSs on my Pixel. You either have to overlay the rpm or use a non-atomic distro.

      Systemd sysext is being thrown around as the solution to this problem as the way to install software that needs to be unsandboxed but without modifying the base OS. But I don’t see why instead we can’t just still be able to install RPMs on the base system, but to places like /usr/local/bin. The systemd sysext method seems like an unnecessary reliance on systemd and additional complexity. Take this for example: https://github.com/mmcnutt/Bazzite-Discover-Sys-Ext. There’s so much work being done, what what is basically just taking the existing Plasma Discover rpm and converting it into a new format.

  • just_another_person@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    2
    ·
    5 days ago

    You’re just describing organizational things, and this is what makes a distribution its own thing in some sense.

    It’s hard to succinctly describe the difference between BSD and Linux, but essentially, in BSD the OS is everything: kernel, tools, extensions…etc. You’re always interacting with the OS when you change something. It’s like interacting with a single binary that has everything packed into it.

    In Linux, the tools provided to manage packages are largely just automation to verify, acquire, unpack, and link the various contents of packages. The OS is the kernel, which is separate from everything else, and aside from custom additions like DKMS modules, everything comes from the same source.

    I’m not sure what you mean with the update tooling having some “clear separation of OS from these packages”, but maybe you want to try and expand on that a bit. If you’re talking about BSD, that’s wrong, because all the packages management tools are directly executed from the OS, and change the running OS.

    • Leaflet@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      5 days ago

      I’m not sure what you mean with the update tooling having some “clear separation of OS from these packages”, but maybe you want to try and expand on that a bit

      On FreeBSD and OpenBSD, OS upgrades are handled by the freebsd-update and syspatch commands respectively. User package installs are handled by the pkg and pkg_* commands respectively.

      The pkg tools do not touch the base OS. That also helps avoiding issues like uninstalling critical system packages and makes it easier to wipe the system to a “clean” state, undoing user modifications.

      It’s hard to succinctly describe the difference between BSD and Linux, but essentially, in BSD the OS is everything: kernel, tools, extensions…etc

      It also certainly helps that neither FreeBSD or OpenBSD comes with desktop environments by default. That muddies the water of what is an OS package and what is a user package. If desktop environments were treated as OS packages, then it would not be possible for the users to uninstall the DE apps.

      • just_another_person@lemmy.world
        link
        fedilink
        arrow-up
        1
        arrow-down
        1
        ·
        edit-2
        5 days ago

        The pkg tools do not touch the base OS. That also helps avoiding issues like uninstalling critical system packages and makes it easier to wipe the system to a “clean” state, undoing user modifications.

        Well this is just a subjective and semantic take, and it’s mostly around your individual perception of what happens when you interact with userspace.

        You seem to be assuming that OS provided packages are the only packages people interact with, and that they all require modifications outside of UserSpace, but that is not so. AppImage, Flatpak, various types of container runtime configs…etc. These are all very popular ways to run things without privilege escalation. You can install and run most RPMs in userspace if their packaging doesn’t otherwise require system alterations.

        Re: Desktop Environments. They’re just userspace programs like anything else in unix-like systems. They aren’t part of the OS layer anywhere on BSD or Linux. The APIs they communicate with are the things running with escalated privileges.

        • Leaflet@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          2
          arrow-down
          1
          ·
          5 days ago

          I’m not saying they’re running with special privileges, just that they’re part of the “OS”. Stuff that comes included with every system and that should not be removed.

          • just_another_person@lemmy.world
            link
            fedilink
            arrow-up
            1
            arrow-down
            1
            ·
            5 days ago

            But that’s not accurate. I’m not trying to be pedantic here, just correcting your assumption.

            Think about it like this: there’s Fedora Workstation, and Fedora Server. The only functional difference between those two distros is the package selection. If I install Fedora Server, which comes with no desktop, all I have to do to turn it into Fedora Workstation is install the packages for a desktop environment. No fundamental changes are made to the OS (kernel) at all. Vice versa also works in turning a “desktop” into the server flavor. It’s just packaging.