Upgrading FreeBSD from stable/8 to stable/9, and to stable/10

Update 2015-01-23

Order has once again been restored. I have successfully upgraded 8.4-RELEASE (r251259) to stable/8 r277528, and further to stable/9 r277528, and finally to stable/10 r277559.


Update 2015-01-14

Work is underway enabling latest stable/8 to go directly to latest stable/9.


All my FreeBSD systems have run stable/something-something, compiled from source, for as long as I can remember. I compile and install all ports using the ports collection and portupgrade. I used pre-built binary packages only to get devel/cvsup-nogui up and running, a long, long time ago. I have almost never ended up in a situation from which I could not recover.

Tracking the stable branches has its positive merits. For instance, I remember a bug fix for BIND in stable/{8,9} being committed long before any announcement was made. I guess this was early in 2014. In the meantime my systems were promptly patched, and was secure by the time the announcement came through.

If your system has a separate root filesystem of less than 1 GiB, then I suggest you consider scrapping the existing system altogether, and install a fresh system. If you wish to continue having a separate root filesystem, make that filesystem no smaller than 2 GiB to accommodate future expansion.

Upgrading from stable/8 to stable/9 will(!) require a pit stop at r276385, with r276416 being the problematic commit. Otherwise, you’ll end up with this error message, no matter if you build world in parallel or not.

===> lib/libmagic (obj,build-tools)
cc -O2 -pipe -DMAGIC='"/usr/share/misc/magic"' -DHAVE_CONFIG_H -I/usr/src/lib/libmagic -I/usr/src/lib/libmagic/../../contrib/file/src -std=gnu99   -I/usr/obj/usr/src/tmp/legacy/usr/include -DCOMPILE_ONLY -L/usr/obj/usr/src/tmp/legacy/usr/lib -o mkmagic /usr/src/lib/libmagic/../../contrib/file/src/apprentice.c /usr/src/lib/libmagic/../../contrib/file/src/cdf_time.c /usr/src/lib/libmagic/../../contrib/file/src/encoding.c /usr/src/lib/libmagic/../../contrib/file/src/funcs.c /usr/src/lib/libmagic/../../contrib/file/src/magic.c /usr/src/lib/libmagic/../../contrib/file/src/print.c  -lz -legacy
In file included from /usr/src/lib/libmagic/../../contrib/file/src/apprentice.c:32:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:488:21: error: xlocale.h: No such file or directory
In file included from /usr/src/lib/libmagic/../../contrib/file/src/apprentice.c:32:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:495: error: expected specifier-qualifier-list before 'locale_t'
In file included from /usr/src/lib/libmagic/../../contrib/file/src/cdf_time.c:27:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:488:21: error: xlocale.h: No such file or directory
In file included from /usr/src/lib/libmagic/../../contrib/file/src/cdf_time.c:27:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:495: error: expected specifier-qualifier-list before 'locale_t'
In file included from /usr/src/lib/libmagic/../../contrib/file/src/encoding.c:35:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:488:21: error: xlocale.h: No such file or directory
In file included from /usr/src/lib/libmagic/../../contrib/file/src/encoding.c:35:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:495: error: expected specifier-qualifier-list before 'locale_t'
In file included from /usr/src/lib/libmagic/../../contrib/file/src/funcs.c:27:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:488:21: error: xlocale.h: No such file or directory
In file included from /usr/src/lib/libmagic/../../contrib/file/src/funcs.c:27:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:495: error: expected specifier-qualifier-list before 'locale_t'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c: In function 'file_regcomp':
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:456: error: 'file_regex_t' has no member named 'c_lc_ctype'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:456: warning: implicit declaration of function 'newlocale'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:456: error: 'LC_CTYPE_MASK' undeclared (first use in this function)
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:456: error: (Each undeclared identifier is reported only once
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:456: error: for each function it appears in.)
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:457: error: 'file_regex_t' has no member named 'c_lc_ctype'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:458: error: 'file_regex_t' has no member named 'old_lc_ctype'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:458: warning: implicit declaration of function 'uselocale'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:458: error: 'file_regex_t' has no member named 'c_lc_ctype'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:459: error: 'file_regex_t' has no member named 'old_lc_ctype'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:463: error: 'file_regex_t' has no member named 'rc'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:463: error: 'file_regex_t' has no member named 'rx'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c: In function 'file_regexec':
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:470: error: 'file_regex_t' has no member named 'rc'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:471: error: 'file_regex_t' has no member named 'rx'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c: In function 'file_regfree':
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:477: error: 'file_regex_t' has no member named 'rc'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:478: error: 'file_regex_t' has no member named 'rx'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:480: error: 'file_regex_t' has no member named 'old_lc_ctype'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:481: warning: implicit declaration of function 'freelocale'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:481: error: 'file_regex_t' has no member named 'c_lc_ctype'
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c: In function 'file_regerror':
/usr/src/lib/libmagic/../../contrib/file/src/funcs.c:490: error: 'file_regex_t' has no member named 'rx'
In file included from /usr/src/lib/libmagic/../../contrib/file/src/magic.c:33:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:488:21: error: xlocale.h: No such file or directory
In file included from /usr/src/lib/libmagic/../../contrib/file/src/magic.c:33:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:495: error: expected specifier-qualifier-list before 'locale_t'
In file included from /usr/src/lib/libmagic/../../contrib/file/src/print.c:32:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:488:21: error: xlocale.h: No such file or directory
In file included from /usr/src/lib/libmagic/../../contrib/file/src/print.c:32:
/usr/src/lib/libmagic/../../contrib/file/src/file.h:495: error: expected specifier-qualifier-list before 'locale_t'
*** Error code 1
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error

As a simple trial, I have during the first few days of January 2015, successfully installed and upgraded an i386 system from 8.4-RELEASE, through stable/8 r276471, stable/9 r276385, stable/9 r276581, and finally arriving at stable/10 r276686.

Remember to forcefully upgrade ports-mgmt/pkg before upgrading any other ports, e.g. portupgrade -fprv ports-mgmt/pkg.


In my next endeavour, I will attempt to migrate a running i386 stable/9 system into a running amd64 stable/9 system, and to migrate a running i386 stable/10 system into a running amd64 stable/10 system, just to see if these tasks are feasible.

All 32-bit test systems will carry a small, but representable arsenal of ports:

  1. ports-mgmt/pkg,
  2. ports-mgmt/dialog4ports,
  3. ports-mgmt/portmaster,
  4. ports-mgmt/portupgrade,
  5. devel/subversion,
  6. misc/mc,
  7. shells/bash,
  8. sysutils/parallel,
  9. sysutils/smartmontools,
  10. and of course, the build and run-time dependencies of the above.

This selection of ports does not rule out any corner cases, but it should serve as a good indicator. If you know of any ports that deserve special attention, please let me know.