Gentoo FreeBSD/Upgrade Guide

This guide will show you how to upgrade Gentoo/FreeBSD 11.1 from previous version. If you are using Gentoo/FreeBSD on a daily basis, please check Gentoo FreeBSD/Upgrade Guide/11.0 instead of this guide.

Changing to the latest profile
It is necessary to change the profile to emerge packages related to FreeBSD 11.1.

Get a list of available profiles:

Set the profile to 11.1:

Updating sys-apps/portage with a manual method.
If you are using the too old version of portage, should be updated. Let's check:

If you got the above messages, please update it with a manual method:

Moving
Currently, has been moved to. If it exists in, please move it to the location.

In addition, don't forget to remove LDFLAGS from. If it is set, the upgrade may fail.

Updating some of the packages to continue the upgrade
You need to update some of the packages to continue the upgrade:

Updating toolchain
A newer version of binutils and gcc are required:

Set the newer version of gcc:

Updating config and make
Latest version of config and make are required to continue upgrading:

Updating kernel
First of all, you need to update your kernel. That is because some userland packages may require functions of the new kernel.

Please be sure to update the kernel first:

Failed to compile the kernel
If it fails to compile, please get the GENERIC kernel of FreeBSD instead. If you are using x86-fbsd, please replace the amd64 to i386 in URL.

Reboot
Don't have any problem? Let's restart to actually use the new kernel:

After rebooting your machine, please check if the upgrade was successful.

Updating FreeBSD userland
If you are upgrading from 9.x, the portage may fail to check dependencies. Let's check:

If it fails to check, some files should be removed to pass checking dependencies. Please note that this step directly changes the package information:

sys-freebsd packages can be updated:

Please emerge the sys-freebsd packages again. Some of the packages are in need of include files of 11.1, which they couldn't use during the previous upgrade.

/usr/local/sbin/config, /usr/local/bin/make, and utmp related files are no longer needed so please remove them:

Changing the CHOST variable and rebuilding the toolchain
Change the CHOST variable, and emerge binutils&gcc. (FYI, Changing the CHOST variable)

x86-fbsd users should issue:

amd64-fbsd users should issue:

Emerge binutils and gcc:

Check the old version number of gcc:

And, remove them:

Also check the old version number of binutils:

And, remove them:

Remove the FreeBSD 9.x env file:

The target file name is in this case.

Removing and re-emerging dev-lang/perl (recommended)
If you are upgrading directly from from the too old version of perl, removing and re-emeging are recommended to upgrade easily.

Removing perl:

Re-emerging perl:

is required by some packages but it cannot be compiled correctly at this time. After rebuilding all packages, you will be able to compile it. A workaround is here:

Rebuilding all packages
If one of the packages fails to compile you can issue 'emerge --resume --skipfirst' to continue emerging the remaining packages. Also, consider filing a bug report of the problem.

Cleaning
Let's remove the backup files when you have finished all the steps:

Re-select profile
Please re-select the profile if exists in.

Sample script to update automatically
You can get the sample script for easy updates.

https://gitweb.gentoo.org/proj/gentoo-bsd.git/plain/scripts/automatic_updater.sh