Skip to main content

Keeping FreeBSD updated

Posted in

When I need to update my FreeBSD (I'm not talking about major release upgrade) I do this:

# freebsd-update fetch

This will look for all available patches for my system. If there are such patches, they get downloaded. Now we need to install them. (If none are available, just skip the next step)

# freebsd-update install

Usually, you don't have to do anything else if you have a GENERIC kernel. As for me, I'm using a configured (tuned) kernel. If this is your case too, then we need to rebuild the kernel and reinstall it.

# cd /usr/src
# make buildkernel KERNCONF=MYKERNEL
... takes some time to build ...
# make installkernel KERNCONF=MYKERNEL

Someone may not like the following

# shutdown -r now

But I do this because I like to see the 'uname' command show me that changes have been applied.

The next thing I usually do is update my ports tree and find out which ports I need to update.

# cd /usr/ports
# make update

Once 'make update' fetches all the necessary patches/updates:

# portmaster -L | grep New

I used to work with portupgrade, but I had some problems with it. One day I got my /var/db/pkg/ corrupted and I could not fix it. I admit that this could have been my fault. After then I switched to portmaster and everything suits me and everything is working great.

So, back to ports.
When I get a list of outdated ports I take a look at them and find those need to be updated. Let say I need to update libgphoto2.

# portmaster -di libgphoto2

Take a break while it gets compiled and installed. And we are done.

Post new comment

The content of this field is kept private and will not be shown publicly.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
o O O
O o o
o o OoO
'o O .oOoO' OooOOo o .oOo 'OoOo.
O o o O o O O O o O
o O O o O o o o O o
`Oo'oO' `OoOo O O' `OoO' o O
Enter the code depicted in ASCII art style.