@morbiuswilters said:
Some packages create subfolders underneath /usr/lib, but the libraries there are still shared. So if I have two apps, Foo and Bar that both want to use libbaz, then they will both use /usr/lib/baz/libbaz.so (for example.)
Well, no. That's how pre-NT windows did it, which could not distinguish between two libraries with the same basename even if they were on different paths. Linux uses the inode number to distinguish libraries, so you can load /usr/lib/baz-1.0/libbaz.so and /usr/lib/baz-1.2/libbaz.so from the process without a problem. No idea how Windows NT does it, but you can certainly do it too.
Also in Linux the entire idea of putting stuff inside a subdirectory in /usr/lib is so that other programs searching for libraries do not find them. Because when a program asks for "libbaz.so" (that is, not specifying the absolute pathname) then it will find /usr/lib/libbaz.so, but not /usr/lib/baz/libbaz.so . That's similar to the idea of DLL search paths in Windows.
If you look closely, virtually the 3 operating systems have very similar if not identical ideas. For example, the concept of application bundles in OS X is virtually the same as application directories in Windows, and the same ideas are used for rpath = $ORIGIN bundles in Linux (used by many propietary programs that do not want to hardcode paths in the binaries).
The big difference in Linux, as Morbs described, is that there is a "central authority" (the distribution) which arbitrates between the various application. Thus, there is no problem if each application dumps its libraries in /usr/lib because the distribution is responsible for ensuring no name conflicts appear. One may argue whether this is the best method or not but it's the way it is. Applications not subject to this "central authority" are supposed to install in /opt which is basically equivalent to "Program Files" in Windows; that is, /opt/<vendor>/<program>/lib/libbaz.so .
BTW, why does community server randomly eat spaces between my words? I don't think I've posted enough in these forums to deserve this punishment...