# Where does pkg_add find my system version?



## mamalos (Oct 2, 2012)

because on my system, outside of my jails I get:


```
# pkg_add -r apache22
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/apache22.tbz...
```

While inside my jails I get:


```
# pkg_add -r apache22
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/Latest/apache22.tbz...
```

Where, as you can see, on the first situation we have 9-stable whereas on the other 9-current. (my rc files are untouched, with respect to this matter)

Thanx all in advance!


----------



## SirDice (Oct 2, 2012)

Believe it or not, it's hardcoded.

http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/pkg_install/add/main.c?rev=1.95

NB 9-CURRENT doesn't exist anymore, I'm guessing these are old binaries.


----------



## mamalos (Oct 2, 2012)

SirDice said:
			
		

> Believe it or not, it's hardcoded.
> 
> http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/pkg_install/add/main.c?rev=1.95
> 
> NB 9-CURRENT doesn't exist anymore, I'm guessing these are old binaries.



 Now *that* I didn't have it coming! HAHA!

OK, this means that I'll definitely have to update my jails on this machine!

Thanx again SirDice!


----------



## phoenix (Oct 2, 2012)

You can set *PACKAGESITE* in the jail env, and point it directly to the packages site you want to use.

For sh-based shells:

```
export PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/
```

For csh-bashed shells:

```
set env PACAKGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/
```


----------

