How to update your FreeBSD kernel and World system
Auto install using freebsd-update
See: How to use freebsd-update to update your FreeBSD kernel and world system
Manual Update World / Kernel
Its advised to run this in Screen, you can install it from /usr/ports/sysutils/screen.
First you have to update the SRC and Ports tree, follow the manual on this page to complete this step.
Next is to configure the make.conf so it won't install things we don't want.
Be sure you check out man make.conf for some make optimalisation settings.
Here is an example that I use:
WITHOUT_X11=yes NO_GAMES=yes NO_X=yes # make optimalization (-j4, 4 = optimal for 1 cpu) MAKEOPTS="-j4 -B"
In case you have edited (which is a 100% chance you did) files of the world installation you might need to edit the mergemaster.rc file and add some settings before running mergemaster.
Check this page to view an example: How to configure mergemaster to merge configurations on FreeBSD.
These are the steps to install a fresh kernel and world system. The TMPDIR that I use is because I disabled the ability to execute files on the standard /tmp mount.
mkdir /tmp_world setenv TMPDIR /tmp_world cd /usr/src make clean make buildworld make buildkernel make installkernel make installworld
Merge the world system:
mergemaster
Be sure you check out man mergemaster. For example people use the -p argument. This can be handy in some situations.
Remove temp dir:
unsetenv TMPDIR rm -r /tmp_world
Short versions (might be unsafe):
# Kernel & World mkdir /tmp_world ; setenv TMPDIR /tmp_world; cd /usr/src; make clean make buildworld && make buildkernel && make installkernel && make installworld mergemaster unsetenv TMPDIR; rm -r /tmp_world # Kernel-only mkdir /tmp_world ; setenv TMPDIR /tmp_world; cd /usr/src; make clean make buildkernel; make installkernel unsetenv TMPDIR; rm -r /tmp_world
Remove builded objects, only after a release upgrade:
cd /usr/obj chflags -R noschg * rm -rf *
Custom KERNEL
cd /usr/src/sys/i386/conf/ cp GENERIC YOURKERNEL echo "# Kernel configuration" >> /etc/make.conf echo "KERNCONF=YOURKERNEL" >> /etc/make.conf
Compile the same as above, only leave out the buildworld and installworld.
How to upgrade CakePHP or any other package that is under subversion control with Rsync
Actually this is more simple than you might think.
First you checkout your current version. Then download and un-tar the new version and simply run the following command on your shell/terminal:
rsync -av --exclude '.svn' --exclude '._*' my/new/cakephp-cakephp-efb6e08/ my-old-cakephp/
This will exclude your Subversion .svn directories and it will also exclude the META-data files created by Mac OS X.
Good luck with upgrading!
How to create a patch to update one of your projects its external vendor code.
I use this way to upgrade projects such as DokuWiki and CakePHP.
The advantage of this method is you will keep modifications you have made in the code of that vendor.
In my description I use FreeBSD and Mac OS X so you might need to adjust the commands for a different Operating System.
Create the patch file
First download the old and the new version code from your vendor site. In this example this is the website of CakePHP.
You need this that you can match the old version to the new version you want to upgrade to.
Create a temp directory to work in.
mkdir myUpgrade cd myUpgrade
Download the two versions of CakePHP, your current and the version you desire to upgrade to
- http://github.com/cakephp/cakephp1x/tarball/1.3.0-RC3
- http://github.com/cakephp/cakephp1x/tarball/1.3.0-RC4
Unpack tarballs:
tar -xzvf cakephp-cakephp1x-348e5f0.tar.gz tar -xzvf cakephp-cakephp1x-f63ab48.tar.gz
Now create the aptch width using the diff utility:
diff -Naur -x '.svn' -x '._*' cakephp-cakephp1x-348e5f0 cakephp-cakephp1x-f63ab48 > cakephp.diff
Applying the patch
To apply the patch file you created in the previous step, change into your real vendor directory and run the patch tool.
You may first want to do a test run to see if any conflicts may happen and what files are affected:
cd myUpgrade patch -E -p1 < ../cakephp.diff --dry-run
The output should be something like this:
patching file cake/VERSION.txt patching file cake/basics.php patching file cake/config/config.php *etc*
When you're happy, apply the patch:
patch -E -p1 < ../cakephp.diff
Once patch is applied you're done




