[4122007] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[4122007] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
[4afc2603] | 8 | <sect1 id="position">
|
---|
[d5f2a3f] | 9 | <?dbhtml filename="position.html"?>
|
---|
| 10 |
|
---|
| 11 | <sect1info>
|
---|
| 12 | <date>$Date$</date>
|
---|
| 13 | </sect1info>
|
---|
| 14 |
|
---|
| 15 | <title>The /usr Versus /usr/local Debate</title>
|
---|
| 16 |
|
---|
| 17 | <para><emphasis>Should I install XXX in <filename>/usr</filename> or
|
---|
| 18 | <filename>/usr/local</filename>?</emphasis></para>
|
---|
| 19 |
|
---|
| 20 | <para>This is a question without an obvious answer for an
|
---|
| 21 | LFS based system.</para>
|
---|
| 22 |
|
---|
[4afc2603] | 23 | <para>In traditional Unix systems,
|
---|
| 24 | <filename class='directory'>/usr</filename> usually contains files that come
|
---|
| 25 | with the system distribution, and the
|
---|
| 26 | <filename class='directory'>/usr/local</filename> tree is free for the local
|
---|
| 27 | administrator to manage. The only really hard and fast rule is that Unix
|
---|
| 28 | distributions should not touch
|
---|
| 29 | <filename class='directory'>/usr/local</filename>, except perhaps to create
|
---|
| 30 | the basic directories within it.</para>
|
---|
[d5f2a3f] | 31 |
|
---|
[4afc2603] | 32 | <para>With Linux distributions like Red Hat, Debian, etc., a possible rule is
|
---|
| 33 | that <filename class='directory'>/usr</filename> is managed by the
|
---|
| 34 | distribution's package system and
|
---|
| 35 | <filename class='directory'>/usr/local</filename> is not. This way the
|
---|
[d5f2a3f] | 36 | package manager's database knows about every file within
|
---|
[4afc2603] | 37 | <filename class='directory'>/usr</filename>.</para>
|
---|
[d5f2a3f] | 38 |
|
---|
[24ca7aa] | 39 | <para>LFS users build their own system and so deciding where
|
---|
| 40 | the system ends and local files begin is not straightforward. So the choice
|
---|
[4afc2603] | 41 | should be made in order to make things easier to administer. There are
|
---|
| 42 | several reasons for dividing files between
|
---|
| 43 | <filename class='directory'>/usr</filename> and
|
---|
| 44 | <filename class='directory'>/usr/local</filename>.</para>
|
---|
[d5f2a3f] | 45 |
|
---|
| 46 | <itemizedlist>
|
---|
| 47 | <listitem>
|
---|
[4afc2603] | 48 | <para>On a network of several machines all running LFS, or mixed LFS and
|
---|
| 49 | other Linux distributions,
|
---|
| 50 | <filename class='directory'>/usr/local</filename> could be used to hold
|
---|
| 51 | packages that are common between all the computers in the network. It can
|
---|
| 52 | be NFS mounted or mirrored from a single server. Here local indicates
|
---|
| 53 | local to the site.</para>
|
---|
[d5f2a3f] | 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
[24ca7aa] | 56 | <para>On a network of several computers all running an identical
|
---|
[4afc2603] | 57 | LFS system, <filename class='directory'>/usr/local</filename> could hold
|
---|
| 58 | packages that are different between the machines. In this case local
|
---|
| 59 | refers to the individual computers.</para>
|
---|
[d5f2a3f] | 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
[4afc2603] | 62 | <para>Even on a single computer,
|
---|
| 63 | <filename class='directory'>/usr/local</filename> can be useful if you
|
---|
| 64 | have several distributions installed simultaneously, and want
|
---|
[d5f2a3f] | 65 | a place to put packages that will be the same on all of them.</para>
|
---|
| 66 | </listitem>
|
---|
| 67 | <listitem>
|
---|
[24ca7aa] | 68 | <para>Or you might regularly rebuild your LFS, but
|
---|
[4afc2603] | 69 | want a place to put files that you don't want to rebuild each time. This
|
---|
| 70 | way you can wipe the LFS file system and start from a clean
|
---|
[d5f2a3f] | 71 | partition every time without losing everything.</para>
|
---|
| 72 | </listitem>
|
---|
| 73 | </itemizedlist>
|
---|
| 74 |
|
---|
[4afc2603] | 75 | <para>Some people ask why not use your own directory tree, e.g.,
|
---|
| 76 | <filename class='directory'>/usr/site</filename>, rather than
|
---|
| 77 | <filename class='directory'>/usr/local</filename>?</para>
|
---|
[d5f2a3f] | 78 |
|
---|
[24ca7aa] | 79 | <para>There is nothing stopping you, many sites do make their own trees,
|
---|
[d5f2a3f] | 80 | however it makes installing new software more difficult. Automatic installers
|
---|
[4afc2603] | 81 | often look for dependencies in
|
---|
| 82 | <filename class='directory'>/usr</filename> and
|
---|
| 83 | <filename class='directory'>/usr/local</filename>, and if the file it is
|
---|
| 84 | looking for is in <filename class='directory'>/usr/site</filename> instead,
|
---|
| 85 | the installer will probably fail unless you specifically tell it where to
|
---|
| 86 | look.</para>
|
---|
[d5f2a3f] | 87 |
|
---|
| 88 | <para><emphasis>What is the BLFS position on this?</emphasis></para>
|
---|
| 89 |
|
---|
| 90 | <para>All of the BLFS instructions install programs in
|
---|
[4afc2603] | 91 | <filename class='directory'>/usr</filename> with optional instructions to
|
---|
| 92 | install into <filename class='directory'>/opt</filename> for some specific
|
---|
| 93 | packages.</para>
|
---|
[f45b1953] | 94 |
|
---|
| 95 | </sect1>
|
---|