-1

As we all know /usr/local/sbin, /usr/local/bin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games and /snap/bin are directories that Linux commands ( Except ones that built-in to shell and custom alias'. ). So, some applicatons doesn't needs root password to put their program launcher command to path. I made a launcher for my program and I wonder can I put that to a local path and make my user can install my program without root permissions?

TL;DR: Is there a local path directory? Something like $HOME/.bin maybe.

5
  • Your understanding is flawed - there is nothing special about those directories as far as Linux is concerned, they just happen to be some which are typically included in PATH. Commented Jan 3, 2021 at 8:39
  • So yes? Can you tell me where is the local path? How other applications can install themselves without root permissions? Commented Jan 3, 2021 at 9:21
  • If your actual question is "how can I install applications on a Unix-like without root permissions", you should ask that instead of jumping to a solution. Commented Jan 3, 2021 at 9:43
  • Uh no? I think you didn’t understand my question. Please check it again. Commented Jan 3, 2021 at 9:44
  • 1
    I do understand your question, the short answer is "no". But because you've jumped straight to a solution which is based on a false model of how Unix-like systems work, we now can't help you solve the problem you're trying to solve - I'm trying to help you ask the right question. Commented Jan 3, 2021 at 9:49

1 Answer 1

1

According to this answer:

https://unix.stackexchange.com/questions/316765/which-distributions-have-home-local-bin-in-path

There is a:

~/.local/bin/

Executables that shall appear in the user's $PATH search path. It is recommended not to place executables in this directory that are not useful for invocation from a shell; these should be placed in a subdirectory of ~/.local/lib/ instead. Care should be taken when placing architecture-dependent binaries in this place, which might be problematic if the home directory is shared between multiple hosts with different architectures.

Which goes back to systemd file hierarchy spec: https://www.freedesktop.org/software/systemd/man/file-hierarchy.html

And I found it by looking at my own PATH (Mint Linux):

helena@innsmouth:~$ echo $PATH
/home/helena/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
3
  • Well I’ll just put launcher for my application. Launcher is made with shell script. I wrote a launcher instead of just putting the program to $PATH because program is my with Python. Thank you anyways! Commented Jan 3, 2021 at 10:56
  • @maDeveloper if you're using Python, then in your setup.py tell setuptools about your application's enteypoint and let pip install handle installation into the correct paths. Don't write the wrapper scripts yourself. Then the user has more control over where the app will be installed (global, only for this user, or in a Python venv). Commented Jan 4, 2021 at 6:51
  • This is not a library. Why would I let users install to virtual environment? And I know pip install installs the application but my application is system specific so it makes sense. Commented Jan 4, 2021 at 15:43

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.