Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've read better articles on Unix. Just a few thoughts:

1) Software packages should probably install into /usr/local by default, not /usr as the author suggests. Distributions can always pass an option to install into /usr in their build scripts. In my experience as a distro packager, plenty of package-build/install systems install to /usr/local by default (autotools, python's disttools IIRC, etc).

2) FreeBSD (and likely other *BSD OS) ports install into /usr/local. So, if you're using the ports system for package management, you might still be screwed. (Of course, if you, as an admin, don't notice that you're installing over system packages, your system is going to end up hosed some day anyway.)

At the end of the day, go ahead and use /usr/local. But be aware what your system does with it, and that other 3rd party packages may randomly scribble all over it as well.



Regarding point 2, the ports system works a little bit differently to typical package managers, and easily accomodates running customised versions of the software you need.

Another difference between FreeBSD and (most) Linux distros is the concept of the "base system". Things in /bin and /usr/bin are part of the base, any additional packages you install end up in /usr/local. This has the nice effect of separating things you really, really need to work for the system to be functional (i.e. boot and log in) and software that is "nice to have" but not strictly necessary (your webservers and Rubies and what have you). I also find that /usr/local/etc is generally very small and tidy, which makes administration and backup a doddle.

I think the author of the post is a little bit muddled on what /usr/local is for, though - the analogy to installing applications to ~/Applications on OS X is completely flawed, as in OS X that installs things only for the current user, whereas /usr/local is available to all.


True, the linux equivalent would be ~/.local . What I usually do for software I need only for my user is to install it in ~/.local/<package name> and then symlink what I need into ~/.local/bin,lib,etc.. with bin being on my PATH. If the binary needs to see its own libs, I write a small script that sets LD_LIBRARY_PATH prior to execution and use that. This way removing is simply rm -r ~/.local/<package> and I don't pollute the rest of the system.


ElasticSearch does everything (including config) in /usr/local/share/elasticsearch in the vanilla (not distribution specific) install.

Reference:

Personal agony.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: