FreeBSD 5.3 to FreeBSD 5.4 binary upgrade

2009-05-13 01:15:12来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

In February 2005 I put instructions online explaining how to perform a
binary upgrade from FreeBSD 4.8 to FreeBSD 4.11
. When it came time to upgrade my FreeBSD 5.3 system to instead run FreeBSD 5.4, I found that some slightly different steps were needed, so I decided to put together a 5.3-to-5.4 upgrade guide as well.
What follows are the steps I used to upgrade my FreeBSD 5.3 system to FreeBSD 5.4-RELEASE; I can't guarantee that they'll work for everyone, but this should be at least a good starting point.
N.B. I only install the "base" "dict", "doc", and "manpages" distributions here -- I don't want the "catpages", compat, "games", "info", "ports", "proflibs", or "src" distributions. If you want a different set of distributions, change the lists in steps 6, 9, and 10.
  • If you haven't done so already, install
    FreeBSD Update
    . cd /usr/ports/security/freebsd-update && make install clean
    cp /usr/local/etc/freebsd-update.conf.sample /usr/local/etc/freebsd-update.conf
  • Using FreeBSD Update, generate a list of files from the base system which have been locally modified. We might not want to overwrite these. freebsd-update -v IDS | tail +8 | grep . | cut -c 2- - > /root/base-modified
  • Edit this list and delete files for which you don't want to keep your local changes. You'll almost certainly want to delete any lines starting with usr/, but you'll probably want to keep the lines which start with etc/ or var/log/. ee /root/base-modified
    (or use vi or any other text editor you have installed.)
  • Generate a list of files installed which belong to the old RELEASE. We'll be using this list to make sure we don't leave old files lying around after the upgrade. cut -f 1 -d '$' /usr/local/freebsd-update/work/md5all | uniq |
            while read X; do
                    if [ -f $X ]; then echo $X; fi;
            done | sort > /root/base-old
  • Download an ISO image for the new release and mount it. fetch -o /usr/disc1.iso       
    ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-i386/5.4/5.4-RELEASE-i386-disc1.iso
    mdconfig -a -t vnode -f /usr/disc1.iso -u 9
    mount -t cd9660 -o ro /dev/md9 /mnt
  • For the files which have been locally modified, extract the new versions to a temporary directory. mkdir /usr/release
    for dist in base dict doc manpages; do
            cat /mnt/5.4-RELEASE/${dist}/${dist}.?? |
                    tar -xpzf - -I /root/base-modified -C /usr/release
    done 2>/dev/null
  • For each of these files (in /root/base-modified), compare the existing and new versions to see if you need to update anything. (I didn't, but sometimes there are necessary changes in configuration files -- for example, in FreeBSD 4.7 a new "sshd" user was added.) grep ^etc /root/base-modified | while read f; do

    标签:

    版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
    特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

  • 上一篇:Linux Htb队列规定指南中文版(转载)

    下一篇:pure-ftpd+mysql实现限制ip登陆功能