Is there any general, universal way that if I want to install package Foo or build Foo from source, I can have it do everything, install dependencies, etc, in its own "sandbox" directory without modifying anything else on the system?

I'm asking about a way that I as an end-user of the package can use it without modifying anything outside of my chosen "installation directory". Not asking about how a package-maker could set this up.


1 Answer 1


Most of the reasonably advanced packaging systems can install a package into "alternative root" and track package dependencies, hence even if the package manager doesn't offer the option of installing everything needed there on its own, you can script it (by extracting the dependencies and installing those as well).

Note however, that you might need to set up some environment variables (typically PATH and LD_LIBRARY_PATH) to make sure that the appropriate binaries and libraries (i.e. those from the alternative root and not the system ones) are used. Some packages are also looking for some files (configuration, run-time data) in very specific and sometimes not configurable places.

Not the answer you're looking for? Browse other questions tagged .