/usr vs /usr/local

Andrew McMurry andrew.mcmurry at astro.uio.no
Sat Oct 20 05:44:20 PDT 2001

Since many people ask where they should install packages after the
original LFS, I have written something on the subject that may be useful
for the BLFS book.  What do people think?



Should I install XXX in /usr or /usr/local?

This is a question with out an obvious answer for an LFS based system.

In traditional unix systems, /usr usually contains files that come
with the system distribution, and the /usr/local tree is free for the
local administrator to add things to.  The only really hard and fast
rule is that unix distributions should not touch /usr/local, except
perhaps for creating the basic directories within it.

With Linux distributions, like RedHat, Debian etc. a possible rule is
that /usr is managed by the distribution's package system and /usr/local
is not.  This way the package manager's database knows about every file
within /usr.

LFS users build their own system and so deciding where the system ends
and local files begin is not straightforward.  So the choice should be
made in order to make things easier to administer.  There are several
reasons for dividing files between /usr and /usr/local.

a) On a network of several machines all running LFS, or mixed LFS and
other Linux distributions, /usr/local could be used to hold packages
that are common between all the computers in the network.  It can be
NFS mounted or mirrored from a single server.  Here local indicates
local to the site.

b) On a network of several computers all running an identical LFS system
/usr/local could hold packages that are different between the machines.
In this case local refers to the individual computers.

c) Even on a single computer /usr/local can be useful if you have several
distributions installed simultaneously, and want a place to put packages
that will be the same on all of them.

d) Or you might regularly rebuild your LFS, but want a place to put files
that you don't want to rebuild each time.  This way you can wipe the
LFS filesystem and start from a clean partition everytime without losing

Why not use your own directory tree, eg /usr/site rather than /usr/local?

There is nothing stopping you, many sites do make their own trees, however
it makes installing new software more difficult.  Automatic installers
often look for dependencies in /usr/local, and if the file it is looking
for is in /usr/site instead, the installer will probably fail unless
you specifically tell it where to look.
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-dev' in the subject header of the message

More information about the blfs-dev mailing list