3

I am making quite some binaries, scripts, etc. that I want to install easily (using my own RPM packages). Since I want them accessible for everyone, my intuition would be to put them in /usr/bin;

  • no need to change PATH

However, my executables now disappear in a pool of all the others; how can I find back all the executables I put there in an easy way?

I was thinking of:

  • A subdirectory in /usr/bin (I know I cannot do this; just to illustrate my thinking).
  • Another directory (/opt/myself/bin) and linking each executable to /usr/bin (lots of work).
  • Another directory (/opt/myself/bin) and linking the directory to /usr/bin (is this possible?).

What would be the "best, most Linux-compliant way" to do this?

1
  • I just realized I'd better post this question on unix & linux stack overflow... I reposted the question there.
    – Chris Maes
    Apr 2, 2014 at 12:30

2 Answers 2

3

Most systems have /usr/local/bin in their PATH. It is meant for exactly this purpose, to contain binaries installed locally rather than from the repositories. Also there is /usr/local/sbin for locally-installed superuser binaries.

See the Filesystem Hierarchy Standard.

2
  • /usr/local/bin/ is only for local binaries, not really for binaries that are distributed in an rpm..
    – Chris Maes
    Apr 2, 2014 at 18:49
  • 1
    Yes, but he apparently wants to treat them as local, otherwise just use the normal directories.
    – ssmy
    Apr 2, 2014 at 20:16
1

The most straight-forward solution would be to change the system-wide PATH variable. All the files in /etc/profile.d are automatically sourced on login, so adding a file which changes the PATH variable for all users.

For example, do the following as root: cat <<EOF >/etc/profile.d/custom_path.sh export PATH=$PATH:/opt/myself/bin EOF

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.