Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 May 2020 03:42:06 -0500
From:      Scott Bennett <>
Subject:   Re: Updating from 11.3-stable to 12.1-stable?
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Bob Willcox <> wrote:

> On Thu, Apr 30, 2020 at 08:46:52AM -0500, Scott Bennett wrote:
> >      On Wed, 29 Apr 2020 16:27:54 -0500 Bob Willcox <> wrote:
> > >
> > > Well, here are the steps that I took to upgrade my 11.3-STABLE system to
> > > 12.1-STABLE. May not be the best/most efficient but they worked for me
> > > and I thought someone else may benefit from them.
> > >
> > > 1)  Make a backup of the current system
> > > 2)  Delete everything in /usr/src, making certin to remove the files and directories
> > >     that start with a dot (".").
> > > 3)  Delete everything in /usr/obj.
> > > 4)  Download (via svn) the new FreeBSD release /usr/src to be updated to.
> > > 5)  Build the new world from the source.
> > > 6)  Build the new kernel from the source.
> > > 7)  Run "mergemaster -Fp" to update files that may be needing update prior to
> > >     doing the installworld.
> > > 8)  Run "make installworld" in /usr/src.
> > > 9)  Run "make installkernel" in /usr/src.
> > > 10) Run "mergemaster -iU" do update any remaining files that need to be updated.
> > > 11) Reboot the system.
> > > 12) Run "pkg update" to update the pkg database to the new system's level.
> > > 13) Run "pkg upgrade" to update all packages to reflect the new system's level.
> > > 14) Reboot the system.
> > >
> >      If you did things as you state and it worked, you got lucky.  Your step 7) has
> > to be run in /usr/src, just like 8) and 9) and 10).  8) and 9) appear above in
> > reversed order.  Also, you omitted 8.5).  Steps 8) through 9) should have been:
> Yes, step was run from /usr/src. I just failed to point that out. I was still in
> that directory after the builds completed.
> As for the order of installworld and installkernel. I used to run them in the
> order you suggest but found that, as I recall, doing the installkernel first
> didn't always work when I had the nvidia driver specified in my /etc/src.conf
> file. The details are a bit hazy now, but by installing world first the nvidia
> driver was successfully built from ports during the installkernel step.
     When upgrading to a newer kernel, the official recommendation is not to load the
nvidia-driver port and use either the console/vt mode until you complete the OS
upgrade.  After that is done and working, then rebuild the driver with the newer
source tree.  Alternatively, you could simply comment out the kldlist information in
/etc/rc.conf or /etc/rc.conf.local and then uncomment it once the new kernel (and
world, if installed) is working and the port has been rebuilt and installed.  N.B. that
some folks put PORTS_MODULES=graphics/nvidia-driver into /etc/src.conf, which is a
convenient way to have your drivers rebuilt using a newer source tree and automatically
installed by make installkernel when you are only rebuilding your kernel, but this method
fails if you have your root on ZFS and use boot environments to install your upgrades.
It does even worse in a few cases where you have built your new kernel using a newer
source tree than the kernel you are trying to replace because it is possibly incompatible
enough with the current kernel that it either a) won't load at boot time, which is safe,
or b) will load, but cause a kernel panic.  If the newer kernel doesn't actually work,
then you will have an incompatible driver installed.  In any of these cases, all is not
lost, but you will need to tell the boot loader to unload the driver before proceeding
to load whichever kernel you are trying at this point to use.
     If you really feel you must use X11 earlier, then let it autoconfigure to
modesetting until the above has been completed successfully.  When doing system
administration tasks, do them as simply and methodically as possible.  Step by careful
step should be the rule.  Your power as root to devastate your system *unintentionally*
is essentially unlimited.
     The ABIs/APIs for FreeBSD can, and often do, change from one major release to the
next.  If you install the new world before you have a kernel running that can support
the ABI/API for which the new world is built, you may well find that your commands,
conceivably even your shells, no longer work.  Even the shutdown command might not
work, leaving deliberately crashing the system, which carries its own risks, and using
an alternate boot device to restore from your backups.  Even if some commands still
work, others may well not.  (Yes, this is the voice of experience here.  Sigh.)  In
any case, in such a situation the only safe way out is still restoring from backups.
     OTOH, if you follow the officially stated procedure, including the reboot
following installing the new kernel, if that new kernel doesn't work, it is easy to
back down, find and fix whatever went wrong, and try again.
     The GENERIC kernels have compatibility options in their configuration files that
build in the API interpreters for earlier releases.  When the corresponding
misc/compat*x ports have been installed, most userland programs installed under earlier
releases will still work, but should be rebuilt (or reinstalled from packages for the
new release) when you have time.  Note that userland programs built under earlier
releases are *not guaranteed* to work, although they usually do.
> > 
> >  8)  Run "make installkernel" in /usr/src.
> >  8.5)  Reboot.  IFF this new kernel comes up correctly, then proceed to step 9).
> >  9)  Run "make installworld" in /usr/src.
> > 
> > Not doing it like this runs a grave risk of needing to restore the system from
> > backups to make it usable again.  The last time I looked at it, the Handbook
> > laid this procedure out clearly.
> Well, as I have said, perhaps I've been incredibly lucky for these past 20+
> years that I've been doing it this way as I have had no such incidents. I don't

     You may not get bitten often, but the probability is that you will eventually
be chewed on badly if you do things in an unsafe manner long enough.

> doubt that there are risks, just updating a system carries some pretty significant
> risks.
> Guess I sorry I said anything about this...didn't mean to get people riled up.
     AFAIK, nobody here on the list was.  Your posting your procedure allowed others
to fill in the gaps in your understanding and possibly do the same for other users
reading the list or looking in the list archives.  This has been a recurring issue
on this and other lists for many years.  There is so much information in the various
pieces of documentation--FreeBSD is a *big* set of software--that nobody can be
expected to read and notice every detail before they start using the system.
     Best of luck.  I still don't know how I'm going to get from stable/11 to
stable/12, given that stable/12 fails to build on my stable/11 system. :-(

                                  Scott Bennett, Comm. ASMELG, CFIAG
* Internet:   bennett at   *xor*   bennett at  *
* "A well regulated and disciplined militia, is at all times a good  *
* objection to the introduction of that bane of all free governments *
* -- a standing army."                                               *
*    -- Gov. John Hancock, New York Journal, 28 January 1790         *

Want to link to this message? Use this URL: <>