[bash|zsh|...] Missing ~/.local/bin from $PATH as per systemd spec
| Task Info (Flyspray) | |
|---|---|
| Opened By | Martin Rys (C0rn3j) |
| Task ID | 77447 |
| Type | Bug Report |
| Project | Arch Linux |
| Category | Packages: Core |
| Version | None |
| OS | All |
| Opened | 2023-02-10 00:07:29 UTC |
| Status | Assigned |
| Assignee | Sébastien Luttringer (seblu) |
Details
Description: systemd specification requires ~/.local/bin/ to be in $PATH, as per https://www.freedesktop.org/software/systemd/man/file-hierarchy.html - ~/.local/bin/ "Executables that shall appear in the user's $PATH search path."
This can be verified on the running system with systemd-path user-binaries which will output the path.
To fix this in Bash, one could use following code which is taken from Debian and should be put at the end of https://github.com/archlinux/svntogit-packages/blob/packages/bash/trunk/dot.bash_profile :
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
I am not sure how to fix this globally for all shells without edits for each, aside from perhaps a drop-in in /etc/profile.d?
Repro of an issue - This path is used by pip which puts its executables into it when installed with --user:
pip install shell-gpt --user
sgpt will fail because it is in ~/.local/bin/sgpt