# Upgrading questions, good practices



## ibgb (Jan 3, 2017)

Time to upgrade 10.2 and all ezjails to 10.3

Reading the manual, man pages, etc. just want to double check that I am doing it correctly, and make absolutely clear what the manual is inferring.

I did not see it explicitly stated in the manual (Updating and Upgrading FreeBSD) , but the version for a release is fully identified by two components: the release version, and the patch level. This appears as a string like: 10.2 – release #0. This string can be obtained from the command 'uname -a'. As security patches are applied the patch level (#0 to #6) increases.

Is there ever a release with patches already installed?

Would it be a good practice to get and install all of the patches prior to a major or or minor release upgrade? I know people had trouble going from release 10.3 to release 11.0 unless they applied patches to 10.3 whereupon they could then upgrade to release 11.

After patching the main host system,  you should run 'ezjail–admin update' prior to rebooting the system.

After rebooting, pkg upgrade should be done. Now the man page for pkg says  "upgrade a package to *a* newer version." It seems to imply that it would upgrade a single package, and I have used it that way by providing the name of the package. However, it can also be used, can it not, to upgrade all packages by not giving it the name of any package? But the man page does not say that.

Next steps:

freebsd-update -r 10.3-RELEASE upgrade

deal with mergemaster; any tutorials on mergemaster?

reboot with new kernel

next, update basejail: ezjail-admin update -U -s 10.2-RELEASE

now more mergemaster for config files:  mergemaster -U -D /usr/jails/ jailname

now install all the configured new software: freebsd-update install

and more pkg upgrade

I did not see a tutorial here, but digitalocean has some tutorials. It also seems there could be a series on best or good practices as well. Maybe I will find some.

Thanks for making any corrections to my understanding, as screwing up an upgrade could potentially be painful.


----------



## SirDice (Jan 3, 2017)

ibgb said:


> Is there ever a release with patches already installed?


No.



ibgb said:


> Would it be a good practice to get and install all of the patches prior to a major or or minor release upgrade? I know people had trouble going from release 10.3 to release 11.0 unless they applied patches to 10.3 whereupon they could then upgrade to release 11.


Normally it's not needed. But 10.3 had a minor issue that needed to be resolved before you could upgrade.



ibgb said:


> After rebooting, pkg upgrade should be done. Now the man page for pkg says "upgrade a package to *a* newer version." It seems to imply that it would upgrade a single package, and I have used it that way by providing the name of the package. However, it can also be used, can it not, to upgrade all packages by not giving it the name of any package? But the man page does not say that.


After a major version upgrade (10.x to 11.x for example) _all_ ports/packages will need to be reinstalled.



> `freebsd-update -r 10.3-RELEASE upgrade`
> 
> deal with mergemaster; any tutorials on mergemaster?


There is no mergemaster(8) at that point. It's possible you'll be asked to merge a few files though.


> reboot with new kernel
> 
> next, update basejail: ezjail-admin update -U -s 10.2-RELEASE



I suggest updating the host completely before updating any of the jails. Once the host itself is fully updated/upgraded you can move to your jails. It's not a problem to run 10.x jails on an 11.x system. 

After rebooting the new kernel you will need to run `freebsd-update install` two more times.


----------

