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