3 ms·
So what use $HOME/.local/bin for these days?
by wredue 3y ago
So what use $HOME/.local/bin for these days?
- znpy 3y agoEh, afaik /usr/local was for storing stuff installed by the local sysadmin and not distributed by the vendor… ~/.local the was for stuff compiled by each individual user and installed locally (in their home directory). The idea is that if a user needs some kind of software and is able to build it autonomously then they can set $PATH and other environment variables to make it available to the session. Please note that in ~/.local there are bin, man, lib and other directories, so you can pretty much build, install and run what you need without bothering your sysadmin :) These days… some package managers might put stuff in there so that they can work without needing root permission and without messing up with the general system.
- Phrodo_00 3y agoShared computers are still a thing (in computer labs or servers) so that use of .local is still around.
- sph 3y agoAFAIK ~/.local/bin is not in any standard. I create this directory manually after installation and add it to my PATH because it makes sense to me, but it is not mandated by the FHS/FreeDesktop/XDG. None of the mainstream distributions create nor manage that directory for you.
- JoshTriplett 3y ago> AFAIK ~/.local/bin is not in any standard. I create this directory manually and add it to my PATH because it makes sense to me, but it is not mandated by the FHS/FreeDesktop/XDG. Quoting https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html https://specifications.freedesktop.org/basedir-spec/basedir-... : > User-specific executable files may be stored in $HOME/.local/bin. Distributions should ensure this directory shows up in the UNIX $PATH environment variable, at an appropriate place.
- sph 3y agoTIL. Still, I haven't seen any distro create or put it in PATH in the 24 years I've been running Linux.
- derefr 3y agoMost of the $XDG_FOO_DIR dirs are just-in-time created with a `mkdir -p` when something wants to put stuff under them. Given that you're running a program that manipulates the XDG dirs, that program must already exist somewhere else on your system — so it probably doesn't need to write any binaries. It's already installed! Also, language package ecosystem tooling — the one thing most people touch that could end up installing user-local binaries — is generally just lame and doesn't obey XDG. For just one example, "per-user global" installation of Ruby gems (`gem install --user-install foo`), should properly install the gems under ~/.local/libexec/gem, and then symlink the binstubs of said gem into ~/.local/bin. But it doesn't; it just dumps everything into its own ~/.gem dir and then expects you-the-user to figure out what dir under there to add to your $PATH. Same applies to Rust, Go, Python, and every other language I'm aware of. One thing you can do that will almost-assuredly use ~/.local/bin/, though, is to intentionally point an autotools configure script at ~/.local as its --prefix. `make install` will then dump binaries into ~/.local/bin.
- JoshTriplett 3y agoI'd love to see more language tooling install to ~/.local/bin. I think quite a bit of it predates the widespread use of that XDG directory, so adopting it now would require a migration. I think it'd be worth it, but I also think that's why it hasn't happened yet.