Linux – Is it possible to copy paste packages/software to another machine in Linux

buildlinux

Here is a sample scenario :

Start from a new directory say /myapps . Install a separate (pre-compiled or source) python to say ./usr/bin (relative to installation directory and not system /usr/bin) and install various eggs to this custom python . This can be done using perhaps something like buildout .

Now another user having the same OS version just rsync's the folder maitaining the exact folder structure, will he be able to use python just like the other user . Does he have to really install stuff again ?

I thought most of the Linux package manager works like this with /myapps analogous to what /usr is i.e a default convention as to where files should be kept . Compilation is not mandatory unless you want to optimize like the gentoo installation . In other words I think what most package manager do is :

1) Requirements check

2) Copy/Paste of pre-compiled stuff to a standard location like /usr/lib /usr/bin

3) Do a menu update

Some preconditions in the first machine :

Install everything within this directory and not outside of it . It is run as a normal user and no sudo .

In Windows I think this is going to be challenging because of registry etc which I am not sure like normal file system concept . But in *nix should this work as simple as that ?

Best Answer

It's perfectly possible (but usually you achieve the same result with making virtualenv and bundling your entire virtualenv root). You'll get in troubles if some of python packages need external libraries and other user doesn't have them installed (that's why you usually do it with virtualenv and pip bundle/pip freeze).

Package manager runs so-called install scripts. They can contain any code but usually they add required users/groups, edit some other configs (because you can't "install" a line in config; the movement to split all *.conf's to *.conf.d helps a bit but we're not even close to finishing it yet) but with most python packages, you'll be fine.

Related Question