0

Suppose, I create seperate partition for "/usr" directory. This is the directory which contains all user programs. If I switch from one OS to other(for eg. From Ubuntu to Arch Linux or vice versa), can Arch linux run that program?

Will blender that I installed on Ubuntu work on Arch Linux?

4

You can make them run on different distributions with some work.
The main things programs rely on are libraries. These libraries will be stored in different locations in different distributions, but you can find out where these libraries are linked with the ldd command.
For example, this is the output of ldd when run against /usr/bin/vlc on Debian

linux-vdso.so.1 (0x00007fff11969000)
libvlc.so.5 => /usr/lib/libvlc.so.5 (0x00007f597eb01000)
libvlccore.so.5 => /usr/lib/libvlccore.so.5 (0x00007f597e819000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f597e5fd000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f597e3f9000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f597e0f5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f597ddf7000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f597dbe1000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f597d834000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f597d5ee000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f597d3e6000)
/lib64/ld-linux-x86-64.so.2 (0x00007f597ed37000)

You can see that all the libraries are to ones in /lib/x86_64-linux-gnu
While on Arch, libraries for vlc are located in /usr/lib

linux-vdso.so.1 (0x00007fff5a1fe000)
libvlc.so.5 => /usr/lib/libvlc.so.5 (0x00007f84fd7c2000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f84fd5a4000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f84fd3a0000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f84fcff5000)
libvlccore.so.7 => /usr/lib/libvlccore.so.7 (0x00007f84fcce1000)
librt.so.1 => /usr/lib/librt.so.1 (0x00007f84fcad9000)
libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007f84fc892000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f84fc58f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f84fd9e0000)

As you can see, the binaries are located in slightly different locations with the vlc binary itself having different dependences. So theoretically with a Arch install of VLC, I could run it on Debian by linking the libraries to the correct places.
You could also expand the places where the system looks for libraries by setting the LD_LIBRARY_PATH variable like so -
export LD_LIBRARY_PATH=/usr/local/libs:$LD_LIBRARY_PATH

2

I don't think they will. Mixing a /usr partition with different package managers will likely cause conflicts and incompatibilities. The only way I think that it could work is if you're installed software from a generic .tar.gz file to /opt in which case it should work (untested)

1

Different distributions often (but not always) put files in different locations. You can convert packages using alien.

If you are really low on disc space you could install blender on your Arch and Ubuntu partitions, check what is the same and make soft links from files and directories (with all subdirectories) that are the same.

1

First, don't mix /usr between distributions. Each distribution expects to control what's in there, and the distributions will keep overwriting each others' files. /usr doesn't contain user programs (yes, that's what the name comes from, but that's not what the directory has contained in the last 40 years or so), it contains system programs.

Programs from one distribution may run under the other distribution, or they may not. It depends whether the distributions have sufficiently close versions of the libraries that the programs use.

If you install programs under /usr/local or your home directory, and they don't require too specific versions of libraries, then they will work under both distributions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.