# Simple update



## Lovmy (Jun 23, 2015)

Hello,

Sorry I don't speak English very well. I want to know just the best way to fully update FreeBSD.

If I do:

For kernel:


```
freebsd-update fetch
freebsd-update install
```

and rebuild my kernel (no GENERIC kernel)

For ports tree:


```
portsnap fetch extract
portsnap fetch update
```

And for precompiled software:

`pkg update && pkg upgrade`

is it enough?

Best Regards.


----------



## SirDice (Jun 23, 2015)

Handbook: 
Chapter 24. Updating and Upgrading FreeBSD
5.5. Using the Ports Collection
5.4. Using pkg for Binary Package Management


----------



## Lovmy (Jun 24, 2015)

Thank you for your reply but there are some things I do not understand, I read that there were 3 parts in FreeBSD, the kernel, the world and ports. For ports, if I use pkg I will update by

`pkg update
pkg upgrade`

If I use the ports tree I made by

`portsnap fetch
portsnap extract
portsnap update`

But for the world and the kernel?

I use

`freebsd-update fetch
freebsd-update install` for world and then I'm left has recompile the kernel ?

Best regards.


----------



## SirDice (Jun 24, 2015)

freebsd-update(8) updates both the kernel and userland (aka 'world').


----------



## kpa (Jun 24, 2015)

SirDice said:


> freebsd-update(8) updates both the kernel and userland (aka 'world').



Only GENERIC kernel gets updated by freebsd-update(8). The OP (Lovmy) needs to recompile and install his custom kernel as the last step.


----------



## SirDice (Jun 24, 2015)

What's the reason for the custom kernel?


----------



## ShelLuser (Jun 24, 2015)

A few comments about the examples you provided:



Lovmy said:


> I read that there were 3 parts in FreeBSD, the kernel, the world and ports. For ports, if I use pkg I will update by
> 
> `pkg update
> pkg upgrade`


Although explicit use of `# pkg-update` isn't really wrong it is not needed either because pkg-upgrade(8) will always update the repositories automatically. Unless you're using the -U (or --no-repo-update) option.



Lovmy said:


> If I use the ports tree I made by
> 
> `portsnap fetch
> portsnap extract
> portsnap update`


No, this is wrong. That is: it will have the same result but you'd be wasting time.

See portsnap(8). The extract command will do just that: extract and overwrite your _entire_ ports tree. And trust me: that will take a while to do. Although the end result is what you'd wanted (an updated ports tree) the time spend isn't much fun.

The update command is all you need. This will only update the ports which have a new version. So, don't use all those commands together, but instead just use: `# portsnap fetch update` when updating your ports tree.



Lovmy said:


> But for the world and the kernel?
> 
> I use
> 
> ...


See freebsd-update.conf(8) and freebsd-update(8).

This will update your system, depending on your settings in /etc/freebsd-update.conf it will also update / replace your kernel with a GENERIC version. So after running that command you'd need to recompile the kernel yourself.


----------

