Moving libs to /lib

Tushar Teredesai tushar at
Sun Jan 9 11:50:59 PST 2005

Matthew Burgess wrote:

> OK, I'm working on zlib at the moment.  Why do we shift everything to 
> /lib and then rm /lib/ and relink it to /usr/lib?  Why not put 
> all of zlib's dynamic libraries in /lib and be done with it?  Is there 
> something that expects to find /usr/lib/  If so why not just 
> create a symlink?  It seems really backwards putting everything in 
> /lib and then immediately deleting it!
> For those wondering why we're shifting the libs around in the first 
> place, the following binaries, which may be feasibly required during 
> bootup, require zlib: ping, e2fsk.cramfs, mkfs.cramfs.  As /usr may 
> not be mounted when they're required, needs to be in /lib.

As per FHS, /lib only contains the essential libs (and kernel modules) 
to boot up the system. During bootup is not needed, only is needed. Hence*needs to be moved to /lib. 
is only needed during compilation and hence not needed in /lib. 
Additionally, if libz.a is in /usr/lib and is in /lib, when a 
executable/library is being linked against libz, the compiler may find 
the static lib before the shared lib and link statically against libz 
(which is not what you want).


More information about the lfs-dev mailing list