FreeBSD upgrade 10.3 to 11.0

Matthew Seaman matthew at FreeBSD.org
Fri Nov 25 16:51:38 UTC 2016


On 2016/11/25 15:42, B J wrote:
> On 11/25/16, James B. Byrne via freebsd-questions
> <freebsd-questions at freebsd.org> wrote:
>> I am testing out the procedures to upgrade our existing FreeBSD hosts
>> from 10.3 to 11.0 using a bhyve guest configured for the purpose.  I
>> have followed the instructions in the handbook/wiki to the best of my
>> understanding. I have a question about the last step however.
>>
>> One is supposed to reinstall all of the port pkgs one has installed.
>> Is there an automated way to do this provided by the FreeBSD
>> community; or is this a case of roll your own script?
> 
> <snip>
> 
> I have two machines, each with two drives with FreeBSD.  I upgraded
> all of those systems to 11.0 recently and encountered the same thing.
> What finally worked for me was to upgrade the ports with:
> 
> portsnap fetch
> portsnap extract
> portsnap update
> 
> and the packages as well with:
> 
> pkg update
> pkg upgrade
> 
> It seemed that if I didn't do it, the upgrading process would
> overwrite or remove some of the files and libraries, resulting in
> things like Mate and Slim not working properly after I was finished.
> 
> BMJ

Uh -- if you're using pkg(8) with precompiled packages, why do you need
a ports tree installed?

Anyhow, when upgrading from 10.x to 11.0 you should re-install all your
packages.  In fact, you don't need to do this *immediately* you upgrade
your base system -- everything will keep working even though the OS has
been upgraded beneath it.

However, you will need to reinstall everything eventually -- basically
before you start installing any new software or needing to upgrade some
packages to a new version.

That's because what tends to happen is that shared library ABI versions
frequently get bumped at a major version increment.  Now, libc and most
of the important system shlibs are backwards compatible due to the use
of ABI versioning, but that isn't true of *every* shared library in the
OS.  Plus the big problem comes when some program ends up trying to load
two different ABI versions of the same shlib into the same binary --
that's pretty much a guaranteed crash and core dump.

pkg(8) will upgrade almost everything for you if you simply run a 'pkg
upgrade' after your OS upgrade, but it may not catch everything that
needs to be reinstalled.   Therefore the recommendation is to delete
everything and reinstall.  The best way to do that is:

  * Your backups are comprehensive and up to date and you've tested
    that you can restore from them haven't you?

  * Stop most daemons or other long-running software installed from
    ports.

  * Generate a list of everything you installed deliberately (ie. other
    than things pkg needed to install just to fulfil dependencies)

   # pkg query -e '%a == 0' %n > /root/pkg-list

  * Delete all of your installed packages.  (Be careful about deleting
    eg. bash if you use it as your login shell -- switch to /bin/sh or
    /bin/tcsh that comes with the system for this)

   # pkg delete -a

    That will remove everything except pkg(8) itself.  You should make
    sure that /usr/local/bin, /usr/local/sbin and other subdirectories
    of /usr/local are now virtually empty.  Config files under
    /usr/local/etc should still be present unless you've not modified
    them from the default versions supplied with the package, and web
    content under /usr/local/www/* or postgresql database content under
    /usr/local/pgsql/data should also be untouched.

  * Re-install all the packages from the list you made earlier.  pkg(8)
    will automatically add all the packages it needs to fulfil
    dependencies, which can be different to what you needed with the
    previous version of the OS:

  # xargs pkg install < /root/pkg-list

  * Restart the daemons you stopped previously.  Or it may be simpler
    just to reboot and let the normal startup process bring up all the
    daemons again.

	Cheers,

	Matthew


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 972 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20161125/f0a495fa/attachment.sig>


More information about the freebsd-questions mailing list