You are not logged in.

#1 2006-09-07 14:33:21

RajivNair
Member
From: Mumbai,India
Registered: 2006-06-17
Posts: 40

/usr/local/bin

Hello everyone,
Whenever i am installing any s/w from source by compiling,its executable is getting stored in /usr/local/bin.Now im unable to use the s/w by just typing its executable name in the terminal,its giving me an error as "command not found".what i have to do is browse to the directory /usr/local/bin n then run the executable as ./xxxxx.How can i add the directory /usr/local/bin so that it too is checked for executables.
Thanks in advance,
Rajiv Nair.

Offline

#2 2006-09-07 14:46:29

detto
Member
Registered: 2006-01-23
Posts: 510

Re: /usr/local/bin

To compile programs to the "default" or better said prefereed prefix, you should compile it with the corresponding prefix so it looks like

configure --prefix=/usr

To get /usr/local/bin also in your PATH look into /etc/profile. There u'll find on top iirc some paths declared, just put yours there too. big_smile

cheers,
detto

Offline

#3 2006-09-07 15:00:33

Sigi
Member
From: Thurgau, Switzerland
Registered: 2005-09-22
Posts: 1,131

Re: /usr/local/bin

The Arch Way(tm) of installing s/w on your system is to write a PKGBUILD. This may take a little more time but you gain some advantages:
- You can install and remove the built packages using pacman.
(You avoid unneeded files resting on your HD)
- You can install the created package on other Arch Systems without the need to rebuild it
- You can build your package in a secure way (using fakroot)
- You can easily share your created packages in the AUR.

More infos here.


Haven't been here in a while. Still rocking Arch. smile

Offline

#4 2006-09-07 15:02:08

detto
Member
Registered: 2006-01-23
Posts: 510

Re: /usr/local/bin

Sure, this method mentioned bi Sigi is the better way of installing something from source.
My suggest to you now too, try with a PKGBUILD (it really is damn easy wink ) and if that fails write back here. big_smile

cheers,
deTTo

Offline

#5 2006-09-07 15:20:24

Sigi
Member
From: Thurgau, Switzerland
Registered: 2005-09-22
Posts: 1,131

Re: /usr/local/bin

detto wrote:

Sure, this method mentioned bi Sigi is the better way of installing something from source.

Thanks a lot! I just wanted to clarify that this:

configure --prefix=/usr

is also needed in the PKGBUILD if you are going to compile it that way. So detto's statement was absolutely correct!


Haven't been here in a while. Still rocking Arch. smile

Offline

#6 2006-09-07 16:51:04

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: /usr/local/bin

The reason /usr/local/bin/ was not in the $PATH is because arch doesn't support it. Instead compile programs to use /usr/bin.

Offline

#7 2006-09-07 16:57:57

RajivNair
Member
From: Mumbai,India
Registered: 2006-06-17
Posts: 40

Re: /usr/local/bin

thnx a lot detto,it worked
i know all about makepkg n PKGBUILD but dint know about the /etc/profile thing

Offline

#8 2006-09-09 01:19:24

_adam_
Member
From: Dora, Alabama
Registered: 2006-05-18
Posts: 94

Re: /usr/local/bin

i tried searching on the wiki, but can someone explain why arch does not install anything into /usr/local ?

Offline

#9 2006-09-09 01:28:54

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: /usr/local/bin

_adam_ wrote:

i tried searching on the wiki, but can someone explain why arch does not install anything into /usr/local ?

Its something along the lines of "its not necessary, there's no reason it can be run from /usr/bin....[...]...not simple enough....[...]...bla bla"

Offline

#10 2006-09-09 08:09:05

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: /usr/local/bin

Anyway, /usr/local is made just for those things you do not want to be touched by your package manager. So, if for any reason you do not want to write a PKGBUILD for something (if e.g., it is just a little script you wrote and you want to install it system-wide; or you have some reasons to make the compilation routine step by step), then /usr/local is then just the right place: /usr/local/bin and /usr/local/sbin for executable with various permissions, /usr/local/lib for the libraries, may be /usr/local/src for the sources, etc. Then you should just modify your /etc/profile (or your .bashrc, .zshrc).

This is not what is supported by arch, but it is something you can always do, if you like so, in any linux system of the world.


Mortuus in anima, curam gero cutis

Offline

Board footer

Powered by FluxBB