Installation into an alternative target directory

How can it be achieved that the installation of a software package will not be performed into a well-known directory like “/usr/local”?
Would you like to select a special test or demonstration directory for the installation of any software packages?

Well the packages are set to install in a given directory. But if you compile from source you can set things to any place you want most often ~/bin. You would need to modify the rpm file to install for standard binaries

  • How are the chances that installation commands from RPM packages can be redirected to an alternative target directory?
  • How good do relocatable packages work so far?
  • When will the parameter “–prefix” be also supported by other software management tools like “zypper”?

But if you compile from source you can set things to any place you want most often ~/bin.

I am looking for further possibilities to avoid or reduce the efforts for building selected software once more just to choose a different folder for the corresponding installation at the end. :\

Look at man RPM for details
Depends on the program and how tight it is set to be installed in a give local
Ask the developers. None hang here

Would you like to share any more ideas around the topic “Making a Relocatable Package”?

elfring@Sonne:~> rpm --install --prefix ~/Probe
error: package Mesa-libGL1 is not relocatable

After a quick read: If you actually need this for packages, use OBS. Generally speaking the spec file of an rpm is the place where paths etc. are configured.
But, since rpms are archives, you could also extract the content and move it where ever you want. Messy stuff though if config files are included.