News for hackers. Stuff that matters.
Re:Fedora 40 Plans To Unify /usr/bin and /usr/sbin by wredue on Sunday December 24, 2023 @05:18PM (#38757514)
So what use $HOME/.local/bin for these days?
Re:Fedora 40 Plans To Unify /usr/bin and /usr/sbin by sph on Sunday December 24, 2023 @05:28PM (#38757614)
AFAIK ~/.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.

Re:Fedora 40 Plans To Unify /usr/bin and /usr/sbin by JoshTriplett on Sunday December 24, 2023 @05:31PM (#38757645)
> 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-... :

> 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.

Re:Fedora 40 Plans To Unify /usr/bin and /usr/sbin by sph on Sunday December 24, 2023 @05:32PM (#38757657)
TIL.

Still, I haven't seen any distro create or put it in PATH in the 24 years I've been running Linux.

Re:Fedora 40 Plans To Unify /usr/bin and /usr/sbin by derefr on Sunday December 24, 2023 @05:53PM (#38757827)
Most 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.

Re:Fedora 40 Plans To Unify /usr/bin and /usr/sbin by JoshTriplett on Sunday December 24, 2023 @06:31PM (#38758083)
I'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.
Re:Fedora 40 Plans To Unify /usr/bin and /usr/sbin by znpy on Sunday December 24, 2023 @05:24PM (#38757571)
Eh, 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.

Re:Fedora 40 Plans To Unify /usr/bin and /usr/sbin by Phrodo_00 on Sunday December 24, 2023 @05:29PM (#38757622)
Shared computers are still a thing (in computer labs or servers) so that use of .local is still around.