# Upgrading ports in a jail



## diogenes (Feb 12, 2009)

I am looking for the best method to update my packages within my jails.

I am using ezjails and created them somewhat based upon this howto:
http://wiki.freebsd.org/AppserverJailsHOWTO

I have a build jail that I used to run the "make package-recursive" and copy the pkg's to the appropriate jail.  Once I am done copying the packages to the appropriate jail, I tar up the package folder in the build jail remove the packages and repeat the process for the next jail.

Any thoughts about the best method to upgrade the packages in all my various jails would be great.

Thanks!


----------



## Mel_Flynn (Feb 12, 2009)

Install a lightweight webserver (www/nginx for example) on the build jail, make it's document root /usr/ports/packages.
Set PACKAGESITE in your other jails to point to http://build.jail.host.name/All/.
Now you can pkg_add -r in all jails and save the tarring.


----------



## vivek (Feb 12, 2009)

Mel_Flynn said:
			
		

> Install a lightweight webserver (www/nginx for example) on the build jail, make it's document root /usr/ports/packages.
> Set PACKAGESITE in your other jails to point to http://build.jail.host.name/All/.
> Now you can pkg_add -r in all jails and save the tarring.



Great tip. 

To OP, you can also mount /usr/ports using mount_nullfs for each jail and users can install and upgrade packages.


----------



## diogenes (Feb 13, 2009)

Thanks for the tips guys! I will let you know how the process goes.


----------

