# After freebsd-update, use pkg upgrade instead of portmaster?



## stefanlasiewski (Oct 2, 2014)

I'm performing a major version upgrade of FreeBSD using `freebsd-update.` The FreeBSD Handbook, in section 24.2.3.3. Rebuilding Ports After a Major Version Upgrade suggests I run `freebsd-update -r X.Y-RELEASE upgrade` and then update all ports using `portmaster -af`.

But, updating using ports takes a long time, and is labor intensive and error-prone. Can I simply upgrade all third-party-software using pkgng instead? Perhaps with `pkg update`?


----------



## frijsdijk (Oct 2, 2014)

*Re: After freebsd-update, use pkg upgrade instead of portmas*

It depends what ports you have installed on the system, if pkg is an option to upgrade the ports. You could try a `pkg upgrade -nf`, that should show you what is upgraded (but it's a dry run, so nothing will actually happen).


----------



## stefanlasiewski (Oct 2, 2014)

*Re: After freebsd-update, use pkg upgrade instead of portmas*

Thanks for the confirmation. `pkg upgrade --dry-run --force` looks like a good thing to try.


----------



## SirDice (Oct 3, 2014)

*Re: After freebsd-update, use pkg upgrade instead of portmas*

To answer the original question, no, it doesn't matter if you use packages or ports. The only thing that matters is that everything is reinstalled. This is simply due to the changes in libraries of the base OS, third party applications need to be specifically built for a certain version. So, yes, you can use pkg(8) but you should use `pkg upgrade -f` to force a reinstall of everything. A `pkg upgrade` would only update packages that happen to be out of date.


----------



## stefanlasiewski (Oct 3, 2014)

*Re: After freebsd-update, use pkg upgrade instead of portmas*

*deleted*


----------



## stefanlasiewski (Apr 6, 2015)

It looks like the FreeBSD handbook has been updated, and now has official instructions on how to do this using `pkg-static upgrade -f`:

From https://www.freebsd.org/doc/handboo...freebsdupdate.html#freebsdupdate-portsrebuild

A forced upgrade of all installed packages will replace the packages with fresh versions from the repository even if the version number has not increased. This is required because of the ABI version change when upgrading between major versions of FreeBSD. The forced upgrade can be accomplished by performing:

`# pkg-static upgrade -f`​


----------

