1

I have an Electron program I want to distribute on all three major OSs. Publishing on Windows and macOS is easy enough; One installation file and we're done, plus the users of these OSs are used to independent application updates through the Internet.

With Linux, I have a couple of problems:

  1. I have a lot of package managers to maintain
  2. I need my package to update through some sort of package manager, that way it is more convenient and doesn't need to connect to the Internet and "phone home"

There are a few ways to tackle this problem, none of them are very good.

  • AppImages, Snaps and Flatpaks are self-contained environments, which creates overhead. AppImages are standalone and therefore annoying to update, while Snaps automatically update by default (no thanks). Flatpak and Snapd are also rarely installed by default.
  • Apart from the serious inconvenience of maintaining at least three packages for, say, AUR/APT/RPM, PPAs simply don't natively work on Debian.
  • Providing a binary or tarball would be easiest for me, but inconvenient for the end user and I couldn't provide conventional updates.

Is there some kind of tool that takes my binary file and distributes it to most distro package managers with little to no hassle? Is there some other magic solution that I've missed? Or is it really this hard to provide an accessible Linux package?

SFR
  • 19
  • 2

1 Answers1

1

If you want to distribute to your users directly, it's conventional to simply supply the sources in a .tar.gz file. The user extracts it and runs ./configure && make && sudo make install DESTDIR=/usr/local or some sort of equivalent that you document.

The difference between making a Windows/MacOS installer and doing what I just said is distributing sources vs binaries. You could deploy binaries if you like.


If you want to deploy an arch, deb, or rpm package instead, consider using cpack. It's especially useful if you are already building with cmake. Just add a few commands to the bottom of your CMakeLists.txt and cpack will use the install commands you've already written to assemble an archive in the format of your choice. There are lots of generators available supporting the formats you mentioned and more.


The next question you asked is about how to deploy this installer. There is no simple cross-distro answer for this. But the windows/macos equivalent would be using the windows/apple stores and I don't think you've gone that route so you're already at an 'equivalent' state. You seem to be more interested in direct deployment instead of submitting through a publisher anyways.


If getting your users to update is important to you, you could:

  • have a notification that they should download the latest version (like lots of windows applications do),
  • Auto-update from your server
  • Deploy your own /etc/apt/sources.list.d/myrepo.list with the initial direct-download *.deb and maintain your own archive (and do the equivalent for other distros). I use reprepro for that.

Finally, I suppose snaps, appimage or flatpak are also alternatives.

Stewart
  • 12,628
  • 1
  • 37
  • 80
  • The necessary tools also need to be installed when building from source, which can be a challenge or entirely impossible for some users. – Murphy Dec 27 '20 at 13:35