# Upgrading Jails



## Ophiuchus (Jan 3, 2013)

Hi everyone,

I have just upgraded my jail host from version 9.0 to 9.1 so here is my question? Jails seem to work without any problems now but, do I have to build and install world for each of my jails? If so, I believe that recompiling packages that are in the jails would be a good idea (or am I mistaken?). 

Thank you in advance...


----------



## SirDice (Jan 3, 2013)

If you want to upgrade your jails you'd have to installworld on them, installkernel isn't needed, there's no kernel inside a jail (it uses the host's kernel).

Ports/packages don't have to be rebuild. But do read /usr/src/UPDATING, sometimes some structures change and ports that use them will need to be rebuild. This doesn't happen very often though and most of the time you don't have to rebuild anything after a minor upgrade.


----------



## knarf (Jan 3, 2013)

I'd recommend sysutils/ezjail and run `# ezjail-admin update -b`.


----------



## fbsd1 (Jan 3, 2013)

Give sysutils/qjail a review.


----------



## Ophiuchus (Jan 3, 2013)

Thank you, this is the exact answer I was looking for...


----------



## Wiedmann (Jan 3, 2013)

Ophiuchus said:
			
		

> I have just upgraded my jail host from version 9.0 to 9.1 so here is my question? Jails seem to work without any problems now but, do I have to build and install world for each of my jails?


I guess this depends on:
- if you build your base/world from source, or if you use freebsd-update
- how you are manage your jails (your own/ezjail/qjail)




			
				knarf said:
			
		

> I'd recommend sysutils/ezjail and run
> 
> ```
> # ezjail-admin update -b
> ```


I prefer binary update, thus I would use something like:

```
# ezjail-admin update -s 9.0-RELEASE -U
```


----------



## Beeblebrox (Jan 3, 2013)

> recompiling packages that are in the jails would be a good idea


Packages installed into each jail need to be updated when the PORT has an update, not when WORLD is updated. Not each port update is essential though.
Updating the packages is most easily done by having a package build jail which builds packages as you like them and stores built binaries in your own repository. The latest tool for this is ports-mgmt/poudriere (have a look at its integration with devel/jenkins also). When your packages have been built this way, al you need to do inside the jail is:
`# pkg upgrade`
(needs pkgng & zfs)


----------



## Ophiuchus (Jan 3, 2013)

Actually I do not use any jail software (ezjail/qjail). 

I follow the instructions on the site.
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails-build.html


----------



## Beeblebrox (Jan 3, 2013)

> Actually I do not use any jail software


Unless the purpose of the jail is very specific (like booting pxe clients) ezjail / qjail are very useful tools because they greatly simplify jail administration & updating - I suggest you read up on them.


----------



## Ophiuchus (Jan 3, 2013)

Yes, I know that you are right, but I learn much more when I try to do things using the harder way.

These are nice programs by the way. I used them but preferred the (more) manual way...


----------



## Beeblebrox (Jan 3, 2013)

Well to answer the first part of your question then,


> do I have to build and install world for each of my jails


Usually, do an upgrade of world for your jail right after you have done a buildworld / installworld for your host. Set DESTDIR and make installworld - that means:
`# make installworld DESTDIR=/pathto/myjail`
You must do this for each jail (DESTDIR) and then you must do some more (mergemaster).

I use both btw, I have a traditional jail for my pxe boot clients (includes a kernel in the world of course) and ezjailed stuff for simpler jails. The jail management tools only update one DESTDIR - the <basejail>. The actual jail folders (lightjails) get the basejail null mounted as readonly hence have nothing to say about world-installed stuff.


----------

