I\'ve written an application which as of yet is not open source and I\'d like to distribute the executable across various linux distros. What\'s the best way to do this, I\'ve l
You should probably provide a native package for each Linux distribution that you officially support (as you officially support them, you'll be testing on them so doing this should be trivial), and provide a .tar.gz which people can drop in for other ones.
Users can always make their own .rpm etc for some alien distribution which you don't support; but they can't complain to you unless it doesn't work on an officially supported OS.
Which OSs do you officially support? You'll obviously need to test on them all (at the very least, you'll need to pass all your regression test suite on each OS on each release).
This is of course complicated if you support multiple architectures.
That's what .rpm and .deb files do BUT you have to be sure that the installee distro has the ability to deal with the .rpm and .deb files. If you want something that's sure to run across multiple distros, where you can't be sure that they will have the right package manager, then you pretty much have to resort to the shell script method. I would advise, if you can get away with it, building your binary for both .rpm and .deb - this way, you get most of the distros covered, and you allow users to install in a way they are comfortable and familiar with, and you don't have to try to roll your own installer / uninstaller shell scripts.
MojoSetup is a user-friendly, perfectly cross-distro solution and nicely-licensed (zlib, very permissive). All it requires is the standard sh
shell which comes with any Linux distribution. It also allows for desktop shortcuts the easy way by creating freedesktop.org spec shortcuts, which are supported by just about all graphical environments for Linux (so just dump in a PNG at different resolutions and fill in the blanks of the .desktop file).
Installers are scripted using the very simple Lua programming language and there are several example installer scripts in the Mercurial repository as well as a lengthy tutorial. There are also many years to back up its development into a lightweight cross-distro installer.
RPM and DEB packages are the two primary mechanisms for distributing binary packages in Linux. RPM is used by RedHat and its derivatives (Fedora, CentOS), while DEB is used in Debian and Ubuntu.
The .rpm and .deb files themselves are generally "dumb" archives, and are installed to the correct locations in the filesystem by pre-installed helper applications. You don't have to worry about writing scripts to install files, unless it's a very complicated application which needs special per-system configuration.
The usual patterns I see for distributing binaries are:
The rpm and deb will store the binaries. You'll need to have a different binaries for each distro or distro variant most likely, just because on different distros things are different like paths.
I recommend starting with the two you have rpm and deb and nail those two distro. Then maybe do a tarball for misc distros have people can extract and directory structure and copy and handle permissions on their own.
Also, for things like deb you can setup a site as a repository. That makes it easy for people to add the repo and get/install the deb in ubuntu very easily. A lot of 3rd party closed source devs do that.