0

I'm building several (> 10) packages as a non-root user from source, and want to install them (for the sake of this question, choose the --prefix= value). Two obvious options are:

  1. Use my home directory, which means I'll have etc/, usr/, var/ and similar subdirs, and within each of them will be the files for different packages. But most of the packages don't interact, so there's isn't much sense in having their files in the same subdirs, and it will make uninstalling kind of a pain I think
  2. Use a separate dir for each package, e.g. --prefix=$HOME/myfooapp, --prefix=$HOME/mybarlib and so on. This will keep everything separate, but now my home dir will fill up with multiple subdirs I don't want to see. Also, some of the packages do interact, so I don't mind them being together in the same place (no need to make the PATH super-long).

Is there some other alternative I'm missing? I mean, I could do

  1. Like Option 2. but in a subdirectory of my home directory, e.g. --prefix=$HOME/opt/myfooapp, --prefix=$HOME/opt/mybarlib

is this the best I can do?

2
  • Definitely not #2. Source packages usually have a make uninstall option, which simplifies the problem in #1.
    – goldilocks
    Oct 2, 2015 at 19:27
  • 1
    There are also programs like Gnu Stow (gnu.org/software/stow) which can help to manage non-packaged software. My vote is for #1, possibly with the use of Stow
    – cas
    Oct 3, 2015 at 0:22

3 Answers 3

2

I think that this is usually a site convention kind of thing. For long-running installations I am reluctant to rely on the $HOME tree and am more inclined to use /opt even if this means setting up /opt// with the appropriate permissions and possibly related directories to use as your standard place for data etc that aligns with some reasonable interpretation of something you can point to such as https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

For me the biggest influence on your use of structure aside from trying not to act directly against convention is on the usage of the server. Do you intend to replace the server image into different environments or the software/data? Do you use shared file systems or require specific partitions to optimise the software? Do you want to include these directories in any backup etc? Do you want to share the execution permissions or data with other user accounts? You may also want to consider setting up certain environment variables in your shared shell profile logins to extend default paths and commonly used build flags.

Hope this gives some food for thought. Of course if is on local machine then do what feels right but don't rule out using /opt as this is the neglected directory tree ;^)

2
  • To answer your question: 1. No. 2a. Yes, it's NFS-mounted 2b. No, this isn't a production/benchmarking environment, I don't care about optimizing it that badly. 3. No, and that's a good point because it reminds me maybe I need to put this stuff in a personal dir of mine that isn't under /home; but the question stands when that's irrelevant. 4. No. Anyway, thanks.
    – einpoklum
    Oct 3, 2015 at 7:20
  • The convention is to install local software under /usr/local
    – vonbrand
    Nov 22, 2015 at 21:27
0

Eventually I decided on $HOME/opt/myfooapp. The reasons are:

  • Options 2 and 3 allow me to separate the file hierarchies of the different packages; that's less of a consideration when you're working on / as the root user - since you have a package manager to help you. I don't...
  • Only option 3 avoids cluttering my home directory with multiple directories having to do with software package installations.
0

I install locally compiled packages with --prefix=$HOME. Less PATH (and other, like MANPATH or even info file location) clutter, and decently written packages won't step on their respective toes anyway.

1
  • Ah, but I might step on their toes by mistake. And if I want to uninstall, rebuild and install again I may get into a bit of trouble.
    – einpoklum
    Nov 22, 2015 at 20:08

You must log in to answer this question.

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