Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Let's say I'm building and installing some third-party software called foo. I want headers in /usr/local/include/foo, shareable read-only data in /usr/local/share/foo, and so on. But let's say foo insists on being difficult and wants me to pick a directory PREFIX and install stuff in ${PREFIX}/include and ${PREFIX}/share and so on. If I choose PREFIX=/usr/local then it might clobber some existing files in /usr/local/include, /usr/local/share, and so on. Are there best practices for where PREFIX should be?

share|improve this question
    
There is always the FSH. –  Iain May 15 '13 at 6:43

1 Answer 1

up vote 5 down vote accepted

That is what /opt is for. Make a directory inside /opt for the self-contained software package. You'll have to add /opt/*/bin to your PATH manually.

share|improve this answer
    
What exactly are "add-on application software packages"? If, hypothetically, foo were the main server daemon running on my machine, would it still be appropriate to install it in /opt/foo, just because it breaks the rules? –  Brian Bi May 15 '13 at 3:20
    
"Add-on" means software that is provided by someone other than the operating system vendor. Yes, your hypothetical example shows exactly how /opt is meant to be used. Software that installs into /opt is a bit rare in the Linux community, since your distro's package manager does a fine job of managing files throughout the filesystem hierarchy. However, it's not wrong, and is in fact quite common practice with Unix flavors that don't have such capable package managers as Linux. –  200_success May 15 '13 at 3:34
    
Fair enough, then. –  Brian Bi May 15 '13 at 3:35
1  
/opt/$VENDOR/$PACKAGE/$VERSION/<pseudoroot filesystem> seems to be a pretty good way to do it. –  Tom O'Connor May 15 '13 at 8:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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