FS#12231 - Add /usr/local/bin to the $PATH
Attached to Project:
Arch Linux
Opened by Chuck U. Farlie (McLovin) - Monday, 24 November 2008, 23:24 GMT
Last edited by Andrea Scarpino (BaSh) - Thursday, 18 November 2010, 20:53 GMT
Opened by Chuck U. Farlie (McLovin) - Monday, 24 November 2008, 23:24 GMT
Last edited by Andrea Scarpino (BaSh) - Thursday, 18 November 2010, 20:53 GMT
|
Details
Description:Add /usr/local/bin to the $PATH
It seems that the default $PATH for everything is /usr/bin , however, when you compile a package, its default install dir is /usr/local/bin. This is an easy thing to fix, just add /usr/local/bin to your $PATH, but it would be alot easier for ppl who may be trying Arch for the first time, and are used to other distros, to have the /usr/local/bin dir added to $PATH already. |
This task depends upon
Closed by Andrea Scarpino (BaSh)
Thursday, 18 November 2010, 20:53 GMT
Reason for closing: Implemented
Additional comments about closing: filesystem 2010.11-1
Thursday, 18 November 2010, 20:53 GMT
Reason for closing: Implemented
Additional comments about closing: filesystem 2010.11-1
I don't care if Fedora or any other distribution just added it to $PATH.
Filesystem Hierarchy Standard (FHS). So it should be supported by Arch Linux, too, and be added to $PATH. It's a minor issue, but official standards should be supported.
See also:
http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/Linux-Filesystem-Hierarchy.html#usr
so not having /usr/local/bin in $PATH does not make Arch non-compliant.
If YOU don't use /usr/local at home and if Arch Linux ships nothing that installs to /usr/local - that is obvious, because /usr/local is not meant for packages installed by a package manager - it doesn't mean that this directory isn't a Linux standard which is meant for containing system wide user scripts. And official Linux defauls should be supported by Arch Linux, too, regardless of wether YOU are using it or not. Many other people are using it.
And I really don't know why it shall hurt you to just add a simple /usr/local/bin to $PATH to fully support FHS. It's one single change for you instead of many changes for many Arch users.
And if YOU don't have anything in /usr/local at home it still doesn't hurt if /usr/local/bin is in YOUR $PATH. There will be no slowdown. If you don't want it in YOUR $PATH at home then you can remove it even if I wouldn't see the sense.
Btw., /etc/profile, where $PATH is set, is not a config file from some upstream but a config file from Arch Linux.
Contra: 1) Arch discourages installing directly, and encourages using PKGBUILDs and installing to /usr/{s,}bin properly, so /usr/local/ should not be needed.
I don't see a problem with adding this, I think having /usr/local/{s,}bin in the path is de-facto standard among distributions. Either way, I'm happy.
Also, stop talking about this as if it were a standard. It is not.
The user in question put their OWN script into /usr/local/bin and expected it to work. By the same token, I can go onto, say, a debian system and put my own script into /usr/sbin and it won't work either. Debian (I believe... maybe it was another distro) doesn't include the sbin directories in the PATH unless the user is root. On *all* systems you have to know what you're doing. Arch is no different.
That said, if people are really that upset about it, post a patch or something. Work begets work. Don't whine that other people aren't doing your work for you.
@Thomas: This is not a matter of whether installing software directly or by using PKGBUILDS. I've written several shell scripts to make some system administration tasks easier. And to separate them from the packages installed by pacman and to be able to access them system wide I put them to /usr/local/bin what this directory is meant for. And I bet I'm not the only one.
@Aaron: Look at any other distribution and read the link I posted above. It is a standard.
diff --git a/core/filesystem/profile b/core/filesystem/profile
index cf461f7..45d1839 100644
--- a/core/filesystem/profile
+++ b/core/filesystem/profile
@@ -29,7 +29,7 @@ test -f "/etc/profile.$shell" && . "/etc/profile.$shell"
umask 022
# Set our default path
-PATH="/bin:/usr/bin:/sbin:/usr/sbin"
+PATH="/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin"
export PATH
# Export default pkg-config path
If you add this to the pros, I think inclusion of /usr/local{s,}bin is acceptable.
The sequence of path prefixes that certain functions and utilities apply in searching for an executable file known only by a filename. The prefixes are separated by a colon (:) When a non-zero-length prefix is applied to this filename, a slash is inserted between the prefix and the filename. A zero-length prefix is a legacy feature that indicates the current working directory. It appears as two adjacent colons (::), as an initial colon preceding the rest of the list, or as a trailing colon following the rest of the list. A portable application must use an actual pathname (such as .) to represent the current working directory in PATH. The list is searched from beginning to end, applying the filename to each prefix, until an executable file with the specified name and appropriate execution permissions is found. If the pathname being sought contains a slash, the search through the path prefixes will not be performed. If the pathname begins with a slash, the specified path is resolved (see pathname resolution ). If PATH is unset or is set to null, the path search is implementation-dependent.
The few people who actually need it can change the PATH environment variable themselves. It's easy.
Has anything actually changed since we last closed this as "Won't Fix"? I see nothing to convince me to add it. In fact complaining that you put scripts in /usr/local/bin and they do not run actually wants me to keep it out. I'd prefer some sort of competence among Arch users and setting the bar at being able to adjust the PATH is quite a low one...
And I don't think that this has anything to do with competence. Not to mention that more and more normal users will be using Arch Linux in the future. So I don't think that Arch Linux is just for Linux professionals. But that's not the point of this issue.
Like I said I was able to add /usr/local/bin to $PATH by myself. Otherwise I had opened a or re-opened this bug a few years ago. So I don't think that this is the question.
I would rather hear the real reason for not adding it. Which is "we would like to add it, and we think it should add it" however the reason we dont is because it confuses new users when they build software by hand. We would rather promote the use of PKGBUILD's . However as nice as PKGBUIlD's are they do not cover all basis. Which is exactly what /usr/local is for.
"Package your application.
LSB-conforming systems promise to be able to install an LSB-compliant RPM. However, you need not limit yourself to that format, with the caveat that the packaging technology you choose must work on an LSB-compliant system. For example, a compliant shell script with a tarball is an acceptable format. Your own installer is acceptable, too, as long as the installer itself is LSB compliant."
So they declare rpm as a standard but tar.* as in Arch Linux is LSB compliant, too. They also mention deb somewhere else. And it is possible to install rpm packages on Arch Linux. If this makes sense and if this is the recommended way for installing packages on Arch is a different question. And I bet that the Arch packages can principally be installed on other distros, too.
Here is my PATH from a RHEL 5 installation:
/home/lisaev/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/cern/2003/bin:/cern/2003/include:/cern/2003/lib:/cern/root/bin:/cern/pro/bin:/opt/grace/bin
As you can see, there is /usr/local/bin, but no /sbin and /usr/sbin. Meanwhile, the latter two dirs are also a standard, according to you... Have you seen a bug report to RH's bugzilla against this issue?
We do have /sbin:/usr/sbin in the default PATH. If you want to change something in /etc/profile, removal of these will actually be useful from the security standpoint.