Artix Linux Forum

Artix Linux => System => Topic started by: avidseeker on 05 May 2022, 16:52:34

Title: binaries are installed in ~/.local/bin
Post by: avidseeker on 05 May 2022, 16:52:34
I thought `~/.local/bin` directory is designated for user's personal scripts. But I see that ipython, pip, and other python programs are also installed there.

Questions:
1. how do I prevent future installations in that folder? (I want it just for my personal scripts)
2. why aren't they installed in /usr/local/bin or /bin?
Title: Re: binaries are installed in ~/.local/bin
Post by: strajder on 05 May 2022, 17:49:55
Installed, by what program?

It is advised to use Artix/Arch packages with the python- prefix rather than pip, to avoid potential package conflicts in the future.

See the documentation of a particular program to become familiar with its options and behavior.

/usr/local is defined in the FHS (https://refspecs.linuxbase.org/FHS_3.0/fhs/ch04s09.html) as:
Quote
The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated.
Title: Re: binaries are installed in ~/.local/bin
Post by: capezotte on 05 May 2022, 19:05:57
The specification (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) vaguely says ~/.local/bin is for "user-specific executables", and doesn't at all restrict it to user written scripts.

It's better to move your scripts elsewhere if you don't want them mixed. There's a pip option for specifying a non-default installation path, but it will make modules installed through pip unimportable by other Python scripts without using unsafe environment variables.

Quote
Why aren't they installed in /usr/local/bin or /bin?

/bin and /usr/bin are supposed to be read-only and managed by your system package manager. /usr/local/bin could be a conforming option, but it requires root access to write, so ~/.local/bin is used instead.