I know every distro has its own package manager, some of them share the same package manager, you can even install other package managers.

Besides the source there getting the content from, the formatting of the download and compilation phases, and maybe even a specific programming language; I still can’t wrap my head around why there need to be so many?

What rule says that every distro needs its own package and manager to install any package?

  • Max-P@lemmy.max-p.me
    link
    fedilink
    English
    arrow-up
    9
    ·
    1 year ago

    What rule says that every distro needs its own package and manager to install any package?

    There isn’t, it just happens that usually when you have ideas for a new distro to the point where you don’t want to fork from an existing one, you’re also typically not happy with how the packages are handled/built/versioned or whatever, so you end up making your own packages. Maybe you have an idea to make it different, and before you know it, you end up with a brand new package manager as well. Sometimes you want it to be simpler, maybe you’re trying to avoid Debian’s dependency hell and you end up creating pacman. Maybe you’re targetting routers with 8MB of flash and you come up with opkg to keep it absolutely tiny.

    Then there’s things like Nix/NixOS where they’re like, what if we do everything completely differently?

    and maybe even a specific programming language

    This one’s a bit weird. Historically, that was left to the distributions to provide you with libraries, but as things keep moving it becomes increasingly complicated. On Debian, you can install a whole bunch of Python/Ruby/NodeJS libraries with apt, but because they’re tied to the OS version, they can quickly become outdated. And really that only works on Debian, or Linux distributions. There’s no such things on Windows and macOS. Supporting so many potential versions of your dependencies can quickly become a nightmare for developers just trying to get an app out. So typically there’s always a way to bring your own dependencies as the official support environment. Distros can still decide to do otherwise if they wish, but at least there’s a known good environment.

    So each programming language tend to also have its own package manager so that it’s uniform across the ecosystem, so that when you try to run a NodeJS app, on Windows, you do it about the same way as you would on Linux. These typically install the dependencies in the project’s folder, so they’re fully independent of the system ones which could be too old, too new, patched in incompatible ways. It’s a bit like a sandbox for your project.

    Ultimately, it’s organic growth and people preferring some things over the others, or people experimenting with different things and it takes off. That’s the freedom of open-source, you can achieve things in many different ways based on whatever you prefer. If you want to avoid pip and just install python3-* packages for your personal scripts, power to you.

  • masterofn001@lemmy.ca
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    1
    ·
    edit-2
    1 year ago

    I don’t mind the package manager differences. What i have started to find annoying is different languages or sites requiring their own installers. Like pip or npm or git etc.

    I’ve only ever used debian/ubuntu linux versions and there is some differences, but between dpkg and aptitude/apt-get/apt, it isn’t too much to deal with.

    And some package manager have been designed ground up to work better with a certain build.

    I hear arches manager is super fast. But i’m good with apt.

    It’s all choice.

    • fubo@lemmy.world
      link
      fedilink
      English
      arrow-up
      8
      ·
      1 year ago

      Your OS’s own scripts use Python. So it installs Python by default. But the version of Python that it needs for those scripts, isn’t necessarily the same one that you want to use as a developer. Developers often want to run brand-new versions of open-source software, but the OS depends on stable versions of that same software.

      The current solution is to just completely decouple the two. Your OS’s Python libraries are separate from the Python libraries you’re using as a developer. That way, you can update the latter to whatever unstable version you want, while being confident that you’re not going to break your OS.

      • aDogCalledSpot@lemmy.zip
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Aside from the technical problems you mentioned, it also solves the convenience problem of how to distribute libraries. C/C++ is really bad here because they dont have an integrated management tool. If you want to distribute over Linux package managers, then you will have to package it for every distro, paying attention to best practices and figuring out your dependencies for each one, you’ll also have to put it on the VS package repo for developers using Windows and possibly also support a Windows installer (and uninstaller) for those that dont use VS.

        The alternative is to upload to a single repo and be done.

      • masterofn001@lemmy.ca
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        I’ve found that certain libraries i need to compile come with their own libraries and npm packaged and i end up with several hundred mb of bloat and 12 versions of npm and libraries just to try to install some package.

        Installing a lot of things from github can be more of a pain than it’s worth.

        Especially the first time. When you don’t know that there are now different npm instances on your system and you try to install or update something and you affect your entire system instead of the package directory.

        Npm is not user friendly imho.

    • WontonSoup@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      I guess maybe the thought with pip and npm is they’re very specialized and the others are much more general. Why bloat a package manager with repositories that many will never need when you can download a specialized one for a specific need. No reason to even have access to npm if you don’t code in js or same with pip and python.

      That said a way to add those repositories to other package managers would be nice and maybe possible. I’ve never really researched it.

      But it’s like anything else, get people into your ecosystem rather than someone else’s