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