Hacker News new | ask | show | jobs
by Arnavion 1542 days ago
>I still don't know what I'm supposed to do with /usr/local, what the difference is between /usr/share and /usr/local/share, what the point of /opt is if programs install their files and dependencies in /usr(/local?)/lib anyway [...]

/opt - You put everything related to program foo under /opt/foo . Binaries, libraries, configs, it doesn't matter; all go under /opt/foo. Everything specific to foo should be under /opt/foo, such that deleting /opt/foo also wipes all traces of foo from your system.

/usr/local - Equivalent to /opt/jeroenhd, with a substructure mirroring /usr, ie top-level bin, lib, share directories. If jeroenhd compiles multiple things foo and bar and they all end up under /usr/local, removing them after the fact is hard due to the difficulty of determining what files are foo's and what are bar's.

You say "if programs install their files and dependencies in /usr(/local?)/lib anyway" as if you don't have a choice, but that's up to the programs. Eg anything with a configure script should let you configure the prefix to /opt/foo so that it installs there instead of /usr/local

>[...] and why I have /usr/lib, /usr/lib32 and /usr/lib64 when only two directories and the right environment variables should suffice.

/usr/lib - Architecture-independent libraries

/usr/lib32 - 32-bit libraries

/usr/lib64 - 64-bit libraries

(For the Debian family the arch-specific libraries are mostly in subdirectories of /usr/lib named for the triple, eg /usr/lib/x86_64-linux-gnu)

Not sure which of these you'd excise to be left with only two, or what env vars would have to do with anything.