# Portupgrade cannot find packages, why?



## Xosted (Oct 18, 2011)

Hi everyone,

I am having a weird issue. I have a set of jails which were created with ezjail. One of them is supposed to be used to build packages. It is configured to store built packages in /var/ports/packages/. I have this directory mounted in other jails at the same location with nullfs.

When I run portupgrade in a jail, this one never finds the packages located there. So it uses the ports, compiles, installs and builds the packages to store them... in the exact same place. This takes of course way too much time. What shall I check to ensure that everything is set properly?

Thank you.


----------



## SirDice (Oct 19, 2011)

Xosted said:
			
		

> One of them is supposed to be used to build packages. It is configured to store built packages in /var/ports/packages/. I have this directory mounted in other jails at the same location with nullfs.


Packages should be stored in /usr/ports/packages/ for the system to find them automatically.


----------



## mix_room (Oct 19, 2011)

So you are saying that your build-jail does not recognize output from old runs? Or what is your actual problem? 
Are you able to install packages that you have placed into the directory specified?

Quoting `# man pkg_create`


> -n      Run in ``no clobber'' mode.  If a package tarball exists, the
> pkg_create utility will not overwrite it.  This is useful, for
> example, when multiple packages are saved with several consecu-
> tive runs of pkg_create with the -Rb options.  Saving common
> ...



and from `# man portupgrade`


> -P
> --use-packages         Use packages instead of ports whenever available.
> portupgrade searches the local directories listed
> in PKG_PATH for each package to install or upgrade
> ...



Two helpful things for the future: formulating a good question is hard - do you understand your own question? Secondly - trying to solve the problem on your own is often much more rewarding.


----------



## Xosted (Oct 19, 2011)

Hi thank you for your answer.
I didn't realize that my question was so confusing.

But bottom line is that the PKG_PATH variable is the problem.
I didn't suspect it because I have this line :
[CMD=""]setenv	PKG_PATH	/var/ports/packages/Latest[/CMD]
in each .cshrc in each jail.
But if I use the [CMD=""]echo[/CMD] command, the variable appears undefined.

How do I set this variable to be permanent in each jail?


----------

