I have been using linux for about 2 years now and I have enjoyed every second of it. What in your opinion is the best package manager the linux community has ever offered to us? dpkg, apt, yum, pacman, xbps, zypp, nix, guix, portage, 0install and other tons of them that are out there.

  • @Doug
    link
    44 years ago

    I’ve never used flatpak or snap.d, what advantage do they have over normal apt or dnf?

    • @marmulak
      link
      124 years ago

      Well it’s kind of hard to explain so I hope I do a good job, but package managers like deb and rpm often have packages that involve a complicated set of dependencies and way of handling files that’s tied into the base system. What flatpak does is it brings its own environment separate from the system it’s running on, so like any flatpak program could run on any system provided some basic conditions are met like the system is Linux and there’s an X server running.

      Packages ought to be statically linked and have things they require bundled with them, but they can depend on a “platform” like “Gnome 3.36” or “KDE” that flatpak also provides, so the things most programs rely on flatpak does supply outside of the package itself.

      Additionally flatpak’s update mechanism is ostree (I believe), so even though it might have large packages, updates to them are handled at a more fine-grained level, so the whole package doesn’t get updated just the files that changed get updated.

      So considering some compromises overall, yes it takes up more space, but not too much more space, it updates fast and reliably, and the end result is that you get packages that are basically just end user applications completely bundled and compatible with nearly all Linux distros. The package is the same, doesn’t care if it’s running on Ubuntu or Fedora or Arch or Suse or…

      So anyway yes it has its drawbacks, but I use it on Fedora and it works well for specific things that I choose to use it for. I don’t use it for everything. (I don’t think it’s designed for that.) It is useful in some scenarios, like some closed-source apps (Skype, Anydesk, Spotify, Steam). You push a button and it installs. No hassle. If the software has funny or outdated dependencies, you’re taken care of. Software vendors can choose to provide their application as a flatpak only and it “runs on Linux”, so that’s all they have to care about, not having to maintain a package for each individual distro. For some particular projects that choose flatpak, you get the latest updates direct from the project itself. (In my case, Gajim is a newer version on Flathub even than on Fedora itself, some good projects like Veloren use it.) For the end user it’s zero effort, though I heard it’s strange or unique to package for so for projects/vendors it’s an investment.

      It seems to work well for games and desktop applications. It’s not going to handle system services and OS-level stuff, rather it’s more user-oriented. Something else I didn’t mention is that flatpak is supposed to sandbox the apps so they often run contained, but many apps need to be able to access files in t he user’s home directory anyway. I’ve heard the sandboxing criticized before, but for what I use it for I’m happy with it. It offers some things my distro doesn’t, and many things it does.

      Unfortunately I don’t have much experience with snap. I tried it before once on Ubuntu and it seemed OK but for me at the time it appeared intolerably slow for some reason. I actually switched this machine from Ubuntu to Fedora in part so that I could use flatpak, and I feel it was worth it. For some reason Flathub had more packages I wanted than Snap did. Also keep in mind flatpak’s deal is it’s distro-independent, but I heard snap is basically an Ubuntu-only thing. I don’t know.

      Also it’s worth pointing out that flatpak is not alone in bringing its own everything. guix does that too, so you could install and run guix alongside any distro. I’ve run guix on Fedora too but it wasn’t worth it really, although guix system distribution is so cool.

        • @marmulak
          link
          4
          edit-2
          4 years ago

          I guess that goes along with the “hard to learn/use” for package creators. I have come across a couple packages that seem to do the packaging wrong, like Delta Chat recently updated to the tune of 500 megabytes, and I already had it installed! Most apps when they get updated download a few kilos here, a few megs there, but when I complained about it to the devs their response (on more than one occasion) was something like, “Well that’s just how Flatpak works.” I suspect though they’re doing something wrong and their packaging process could somehow be improved.

      • @Doug
        link
        34 years ago

        Thank you for the informative answer! I might try to take advantage of this once I am able to install Fedora on my current laptop.

      • @Adda
        link
        04 years ago

        This is really a nice explanation. Again, I know a little more now. Thank you for that.