2013-05-18

Procedures to upgrade FreeBSD kernel and base system

Step 1. Excute (3)+(4) <--- optional;

Step 2. Excute ((1)+(2) or (5)+(6))


(1) Update Security Patches
        freebsd-update fetch
        freebsd-update install

(2) Upgrade Major and Minor Version --- kernel and base
        freebsd-update -r 9.1-RELEASE upgrade
        freebsd-update install
        shutdown -r now
        freebsd-update install
        portmaster -f
        freebsd-update install

(3) Update ports collection
        # CVSUP and CSUP were phased out, now use portsnap instead
        rm –rf /usr/ports  
        portsnap fetch update
        # equivalent to “portsnap fetch”+”portsnap extract”+”portsnap update”

(4) Update the documentation sources
        rm -rf /usr/doc
        svn checkout https://svn0.us-west.FreeBSD.org/doc/head /usr/doc
        svn update /usr/doc

(5) Update source tree
        rm -rf /usr/src
        svn checkout svn://svn0.us-east.FreeBSD.org/base/releng/9.1 /usr/src
        svn update /usr/src

(6) Build "world" --- kernel and base [ ref : /usr/src/Makefile ]
        cd /usr/obj
        chflags -R noschg *
        rm -rf *
        cd /usr/src
        make cleandir
        make cleandir
        # Read /usr/src/UPDATING for update procedure
        # Check /etc/make.conf
        # Check /etc/src.conf
        make buildworld
        make buildkernel
        make installkernel
        Reboot into single user mode
        fsck -p
        mount -u /
        mount -a -t ufs
        swapon -a
        adjkerntz -I  # <--- ensure Time-zone setting correctly
        mergemaster -p
        cd /usr/src
        make installworld
        make check-old
        yes | make delete-old
        mergemaster # <---- ( or mergemaaster -i -U )
        # –i –U added to automatically install files that don’t exist and upgrade those that haven’t changed
        Reboot
        cd /usr/src
        make delete-old-libs <--- in case no 3rd party program uses them anymore
        ? portmaster -f
        # There were some changes to the configuration files left in /var/tmp/temproot.
        # Examine these and merge them into your config files.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.