Will a code compiled in one Linux distribution work on all other Linux distribution?

Will a code compiled in one Linux distribution work on all other Linux distribution?

Any Linux based program can work on all Linux distributions. Nowadays I think the questions programmers and software vendors should be asking is “Will my program work on all operating systems”?

What is the point of Linux distributions?

Linux distributions do the hard work for you, taking all the code from the open-source projects and compiling it for you, combining it into a single operating system you can boot up and install. They also make choices for you, such as choosing the default desktop environment, browser, and other software.

What’s the difference between opt and provider in Linux?

A valid reason for diverging from this structure is for support packages which may have files installed in /opt/ ‘provider’/lib or /opt/’provider’/bin. /opt is used for (sometimes proprietary) external applications that aren’t considered part of the Linux distribution.

What should the directories below / opt be?

The structure of the directories below /opt/’provider’ is left up to the packager of the software, though it is recommended that packages are installed in /opt/’provider’/’package’ and follow a similar structure to the guidelines for /opt/package.

What do you do if you have two Linux distros?

Create a new directory in a place accessible to both distros, move the files and symlink from there. Not only does this control exactly what gets shared, but it makes it very easy to move your preferences to other machines, to put them under version control if you need and to back them up.

What happens if I install different Linux distributions?

(as already pointed out) different configuration files for the same programs could result in unexpected behavior. If you install all distributions onto the same boot folder, make sure that the bootloader handles the different distributions correctly.