Linux: Installation directory of application installed only for current user

1.7k views Asked by At

I have a Python application that is currently installed following Linux Filesystem Standard Hierarchy (FHS). It is installed in:

  • /usr/bin/ (executable)
  • /usr/lib/python2.x/site-packages/{appname}/ (Python libs)
  • /etc/{appname}/ (conf files)
  • /usr/share/man/ (manual files)

Now, it is desired that a non-root user installing this application could install it without root powers and that only this user could run the app. We thought the best would be to install the app in user home directory.
We already have a .{appname} directory in user home to keep per-user configuration files, as the app installed configuration files in /etc.
I think that using the .{appname} dir to keep all application files is not a good idea, as directories pre-appended with . only keeps configuration files. Probably I'll remove the .{appname} dir, as the entire application will be installed per-user now.

2 ideas:

  • Create a {appname} dir and create subdirs bin, etc, lib and share/man.
  • Replicate Linux FHS under home and create a {app-name} subdir under lib and etc
    • ~/bin/
    • ~/lib/{appname}
    • ~/share/man/
    • ~/etc/{appname}

Which one of these is more often used and more recommended? Pros and cons of each alternative are welcome. Maybe a third option?

I've seen people recommend /home/usr/bin and /home/usr/local/bin, but I don't understand the need to include the usr here as there is no need to differentiate between essential and non-essential binaries/libraries. I'd prefer to be minimalist.

Thanks in advance.

1

There are 1 answers

0
Ignacio Vazquez-Abrams On BEST ANSWER

The first option is the most common. A third option is to create (or fill out) the structure under ~/.local/ (which reflects /usr) that is already used by a number of applications for share/.