# "which" command missing



## gioloi (Mar 22, 2012)

I'm new to FreeBSD. I need to install Firebird 2.1 Server on a FreeBSD 7 amd64, and I'm doing it via *pkg_add*. The installation interrupts with a error: 
	
	



```
which: not found.[.code]

After some checks I discovered that the [FILE]which[/FILE] command is missing on the system, I think this is strange because it should be a "builtin" command.
So, how to install the "[FILE]which[/FILE]" command? In the ports there is the "Gnu which" that I have installed but it is missing the "[FILE]-s[/FILE]" option that is used in the Firebird installation script so I can't use it.

I don't have physical access to the machine (I access it via ssh) so I need something to download from the internet.
Thanks in advance,

Giorgio
```


----------



## SirDice (Mar 22, 2012)

which(1) is not a built-in, it's an external command (external meaning not build into the shell). It lives in /usr/bin/which. Does that exist?


----------



## gioloi (Mar 22, 2012)

No, it doesn't exist in /usr/bin. *T*he installation is very minimal.


----------



## SirDice (Mar 22, 2012)

Even a minimal install would install which(1).

How did you do the install? Do you have the source tree available in /usr/src/?


----------



## gioloi (Mar 22, 2012)

No I'm not the installer of the system.. I'm working on a machine not installed by me. The source tree isn't avaiable in /usr/src. For example I have installed php by setting the environment variable PACKAGESITE to the ftp server and then via *pkg_add -rv*.


----------



## SirDice (Mar 22, 2012)

Well, without the sources or knowing how the system was installed I have no idea how to fix it.

You could try freebsd-update(8) and hope it comes along during an update.


----------



## gioloi (Mar 22, 2012)

Thanks for your help.

I tried to install Firebird 2.5 and it worked without problems, so the problem is only with 2.1. "which" is missing still, but I have solved my problem with 2.5.


----------



## fluca1978 (Mar 22, 2012)

I would not trust very much the system you are installing onto....sounds like a corruption has happened. It could be either that your admin has deleted which(1) or something bad happened....but this is my opinion.


----------



## wblock@ (Mar 22, 2012)

My guess is that it's not vanilla FreeBSD but an appliance like FreeNAS or pfSense.


----------



## UNIXgod (Mar 22, 2012)

wblock@ said:
			
		

> My guess is that it's not vanilla FreeBSD but an appliance like FreeNAS or pfSense.



Do these remove base?


----------



## wblock@ (Mar 22, 2012)

Parts of it, sure.  For example, a NAS has no need for a C compiler.


----------



## UNIXgod (Mar 22, 2012)

I never realized it. which is actually not POSIX. Learn something new everyday.


----------



## fluca1978 (Mar 23, 2012)

Both FreeNAS 8 and pfsense 1.2.3 do not remove which(1), but it is a good guess that it could be an appliance without such command. Again, if not an appliance, I would not trust very much system because it could have been tampered.


----------

