[f45b1953] | 1 | <sect1 id="intro-important-position">
|
---|
| 2 | <?dbhtml filename="position.html" dir="introduction"?>
|
---|
| 3 | <title>The /usr versus /usr/local debate</title>
|
---|
| 4 |
|
---|
[acfc391] | 5 | <para><emphasis>Should I install XXX in <filename>/usr</filename> or
|
---|
| 6 | <filename>/usr/local</filename>?</emphasis></para>
|
---|
[f45b1953] | 7 |
|
---|
[acfc391] | 8 | <para>This is a question without an obvious answer for an
|
---|
| 9 | <acronym>LFS</acronym> based system.</para>
|
---|
[f45b1953] | 10 |
|
---|
[a4be499] | 11 | <para>In traditional Unix systems, <filename>/usr</filename> usually
|
---|
[acfc391] | 12 | contains files that come with the system distribution, and the <filename>
|
---|
| 13 | /usr/local</filename> tree is free for the local administrator to add things
|
---|
[a4be499] | 14 | to. The only really hard and fast rule is that Unix distributions should not
|
---|
[acfc391] | 15 | touch <filename>/usr/local</filename>, except perhaps for creating the basic
|
---|
| 16 | directories within it.</para>
|
---|
[f45b1953] | 17 |
|
---|
[5628618e] | 18 | <para>With Linux distributions, like Red Hat, Debian etc. a possible rule is
|
---|
[f45b1953] | 19 | that <filename>/usr</filename> is managed by the distribution's
|
---|
| 20 | package system and <filename>/usr/local</filename> is not. This way the
|
---|
| 21 | package manager's database knows about every file within
|
---|
| 22 | <filename>/usr</filename>.</para>
|
---|
| 23 |
|
---|
[acfc391] | 24 | <para><acronym>LFS</acronym> users build their own system and so deciding where
|
---|
| 25 | the system ends and local files begin is not straightforward. So the choice
|
---|
| 26 | should be made in order to make things easier to administer. There are several
|
---|
[f45b1953] | 27 | reasons for dividing files between <filename>/usr</filename> and
|
---|
| 28 | <filename>/usr/local</filename>.</para>
|
---|
| 29 |
|
---|
| 30 | <itemizedlist>
|
---|
| 31 |
|
---|
[acfc391] | 32 | <listitem><para>On a network of several machines all running <acronym>LFS
|
---|
| 33 | </acronym>, or mixed <acronym>LFS</acronym> and other Linux distributions,
|
---|
| 34 | <filename>/usr/local</filename> could be used to hold packages
|
---|
[f45b1953] | 35 | that are common between all the computers in the network. It can be
|
---|
[acfc391] | 36 | <acronym>NFS</acronym> mounted or mirrored from a single server. Here local
|
---|
| 37 | indicates local to the site.</para></listitem>
|
---|
[f45b1953] | 38 |
|
---|
| 39 | <listitem><para>On a network of several computers all running an identical
|
---|
[acfc391] | 40 | <acronym>LFS</acronym> system <filename>/usr/local</filename> could hold
|
---|
| 41 | packages that are different between the machines. In this case local refers
|
---|
| 42 | to the individual computers.</para></listitem>
|
---|
[f45b1953] | 43 |
|
---|
| 44 | <listitem><para>Even on a single computer <filename>/usr/local</filename> can
|
---|
| 45 | be useful if you have several distributions installed simultaneously, and want
|
---|
[acfc391] | 46 | a place to put packages that will be the same on all of them.</para></listitem>
|
---|
[f45b1953] | 47 |
|
---|
[acfc391] | 48 | <listitem><para>Or you might regularly rebuild your <acronym>LFS</acronym>, but
|
---|
| 49 | want a place to put files that you don't want to rebuild each time. This way
|
---|
[666f6de] | 50 | you can wipe the <acronym>LFS</acronym> file system and start from a clean
|
---|
[acfc391] | 51 | partition every time without losing everything.</para></listitem>
|
---|
[f45b1953] | 52 |
|
---|
| 53 | </itemizedlist>
|
---|
| 54 |
|
---|
[acfc391] | 55 | <para>Some people ask why not use your own directory tree, e.g. <filename>
|
---|
| 56 | /usr/site</filename> rather than <filename>/usr/local</filename>?</para>
|
---|
[f45b1953] | 57 |
|
---|
[acfc391] | 58 | <para>There is nothing stopping you, many sites do make their own trees,
|
---|
| 59 | however it makes installing new software more difficult. Automatic installers
|
---|
[f45b1953] | 60 | often look for dependencies in <filename>/usr</filename> and
|
---|
| 61 | <filename>/usr/local</filename>, and if the file it is looking
|
---|
| 62 | for is in <filename>/usr/site</filename> instead, the installer will
|
---|
[acfc391] | 63 | probably fail unless you specifically tell it where to look.</para>
|
---|
[f45b1953] | 64 |
|
---|
[acfc391] | 65 | <para><emphasis>What is the <acronym>BLFS</acronym> position on this?</emphasis>
|
---|
| 66 | </para>
|
---|
[f45b1953] | 67 |
|
---|
[acfc391] | 68 | <para>All of the <acronym>BLFS</acronym> instructions install programs in
|
---|
[f45b1953] | 69 | <filename>/usr</filename> unless specifically stated otherwise. There
|
---|
| 70 | are examples where some files are placed in the
|
---|
| 71 | <filename>/usr/local</filename> hierarchy but these are documented and
|
---|
| 72 | are generally for a good reason. These exceptions should be well documented
|
---|
[acfc391] | 73 | in the book. If you think you have found one which isn't please tell us!</para>
|
---|
[f45b1953] | 74 |
|
---|
| 75 | </sect1>
|
---|