You are not logged in.
Pages: 1
Topic closed
Hi.
I have installed arch linux on a server.
It seems really very good - manged to install latest snort-inline easily...
However (and this is really a completely NOOB question)
- how do I add /usr/local/bin to the default (root) path ?
I have tried to add
PATH=/usr/local/bin
to /etc/enviornment
But it did not show up when using the - env command (after re-logging in)
I know that I could sym link to /usr/bin but i would like to know.
Any help would be good
Cheers
Last edited by yossarianuk (2008-10-02 10:31:21)
Offline
if you want only to specific user edit ~/.bash_profile or ~/.bashrc and put there
export PATH=$PATH:/usr/local/bin
if you want for all users edit /etc/profile and scroll down until you see something like
# Set our default path
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
export PATH
append to the end /usr/local/bin. it will be
PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin"
Last edited by wonder (2008-10-02 10:46:57)
Give what you have. To someone, it may be better than you dare to think.
Offline
Thanks - was just about to reply to the thread - i used
PATH=$PATH:/usr/local/bin in /root/bash_profile
Cheers
Offline
That way you will only have /usr/local/bin on root's PATH. If you want to use it also with other users you will have to add it also to each one's ~/.bash_profile, or use the second option that wonder wrote above.
Offline
if you want for all users edit /etc/profile and scroll down until you see something like
# Set our default path PATH="/bin:/usr/bin:/sbin:/usr/sbin" export PATH
append to the end /usr/local/bin. it will be
PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin"
Don't do that. Make a file in profile.d and a+x it instead.
eg:
echo "#!/bin/bash\nexport PATH=$PATH:/usr/local/bin" > /etc/profile.d/custom.sh
chmod a+x /etc/profile.d/custom.sh
That way pacman can update /etc/profile as needed, without you having to deal with a .pacnew
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
@Mr Elendig: +1
Offline
Put it in /etc/profile or ~/.bashrc.
Merging .pacnews is for sissies.
Offline
isn't using /usr/local/bin frowned upon?
Offline
That's where I store my scripts...
I just added it to my path via .bashrc
Is it really frowned upon ? Why is that ?
Last edited by moljac024 (2008-10-02 23:23:04)
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
I'm probably wrong, but it's not in my $PATH by default, and the PKGBUILD wiki page says
Good thing is, if you already managed to compile the package manually, you basically only need to list the commands you used here, and things should work out just fine. Since many packages like to install their files relative to the /usr/local directory, but Arch Linux prefers using just /usr, you probably want to supply a parameter to the configure script or the make command to take care of this. The prototype PKGBUILD serves as an example for that. It might work differently, though; Again, your mileage may vary.
the bit I bolded may have contributed to a misconception on my part.
Offline
There's a place for all three of /usr/bin, /usr/local/bin, and ~/bin --- even on Arch.
If you download package whizbang-1.2.3 from some non-Arch site, its installer will often by default try to install its files into the /usr/local hierarchy. When making a PKGBUILD, you want to tell it instead to install into $pkgdir/usr, so that when you install the resulting pkg file with pacman, it goes into the /usr hierarchy. That's what the wiki page is saying: pacman-managed stuff goes into the /usr hierarchy.
/usr/local/* is for files you want to install systemwide without making a PKGBUILD. Your own scripts are a great example. Also you might want to install some compiled files that way, if making a PKGBUILD isn't worth it or you don't have the time to write (*and maintain!*) one.
~/bin is for scripts (could be compiled files too) that you want to only be available to that specific user.
Offline
~/bin doesn't load by default in my case.
And I don't know how to add to PATH, AND make it available for GUI apps.
.profile doesn't exist.
Last edited by polv (2021-05-04 09:32:41)
Offline
Please don't necrobump 13 year old threads. Read: https://wiki.archlinux.org/title/Environment_variables it should answer both of these questions.
Closing.
Offline
Pages: 1
Topic closed