4

I am interested in setting up my machine so that I can try different distributions of Linux. I want to always be running Ubuntu (10.04.3), but would then try other distros in a dual-boot setting.

Since the file hierarchy will be similar, I am wondering if the programs that I install and the settings in Ubuntu will work on the 2nd/test distro side?


If so, does it make sense to mount /opt, /usr /etc /var each on a separate partition so that I can then mount the same files in the corresponding folders the 2nd/test distro side?

Is it worth it to try to use these files in both systems simutaneously? Or is it easier just to change settings and re-download programs in each system? If yes, why? If no, why not?


I am speculating that it will depend heavily on the distro, so if that is the case, then answer the question for:

  • Linux Mint, and
  • all other Debian based distros.

(ie, "would this work for all Debian based systems?" -- I am not looking for an answer for each one.)


Update by OP:

  1. It was dumb to suggest moving /etc to a separate partition: According to the Ubuntu documentation, the root partition must always contain /etc or else you can't boot.
Brian Dant
  • 1,005
  • 2
    Assuming it worked well: If you replace the 2nd distros programs and settings by Ubuntu's, you won't be running that second distro, you'd be essentially running Ubuntu with that distro's kernel. – Mat Nov 22 '11 at 19:38

3 Answers3

4

You can run programs from another distribution. However, not all programs will run straight out of the box. A number of programs need files in a specific place or on the search path, that your main distribution might not provide or might provide in a version that isn't suitable. For example, if a program needs a particular library that's only in /otherdistribution/usr/lib, it won't find that library unless you tell it where (LD_LIBRARY_PATH=/otherdistribution/usr/lib /otherdistribution/usr/bin/someprogram). Or if a program is looking for its data files in /usr/share/myprogram, you need to tell it to look in /otherdistribution/usr/share/myprogram somehow.

If you want to run a distribution and occasionally run programs from another distribution (or another version of that same distribution, say Debian stable and Debian testing), the easiest approach is to access other distributions through chroot. And the easiest way to do that on Debian-based distributions is through schroot (you may find this guide to setting up a schroot useful).

3

For /opt it makes sense, for the other's not. Just compare library versions and your /etc directories' layout.

In fact with /opt I did more or less the same. My /opt directory had withstanded several distro upgrades and changes. Although every now and then you might need to fiddle around.

Philip
  • 238
2

It depends on the application, how it was linked (static or dynamic) and whether all relevant files are placed within reach of the application folder.

Use ldd on the binaries/libraries of the application to see the dependencies. No dependency should be shown as "missing". If you have a lot of specific dependencies live gets harder.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
Nils
  • 18,492