View Single Post
  #1   (View Single Post)  
Old 13th September 2010
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,053
Cool HOWTO: FreeBSD Binary Upgrade (base system + packages)

There are many ways to upgrade FreeBSD along with installed packages to the newest version(s), most of them include compilation (buildworld/portmaster), this HOWTO will provide simple and fast way to upgrade FreeBSD system without needless compilation.

Upgrade if the base system is relatively easy, its about to type 4 commands, read and UNDERSTAND on screen comunicates, if it goes to packages, we will use the fact, that all packages are build to newest version along with newest *-RELEASE version.

0. CONFIGURATION BACKUP (rather not needed, but ...)
root # tar -czf /root/ETC.tar.gz /etc /usr/local/etc

1. BASE SYSTEM UPGRADE (I assume that 8.1-RELEASE is the current latest version)
root # freebsd-update upgrade -r 8.1-RELEASE
root # freebsd-update install
root # shutdown -r now
root # freebsd-update install

While doing the base system procedure we will be asked for installed 'datasets' and about modifications in config files, we only need to read and UNDERSTAND the on screen comunicats.


2. PACKAGES UPGRADE
root # pkg_info -qoa > /root/packagelist
root # pkg_delete -a -f
root # rm -r -f /boot/modules /usr/local /var/db/pkg
root # while read PKG; do pkg_add -r $( basename ${PKG} ); done < /root/packagelist

At this point all old packages have been removed, and latest pacakges have been installed on their place, it works automatically, unless port nam has changed, like with VirtualBox, when its port name changed from emulators/virtualbox into emulators/virtualbox-ose, so the only 'risk' here, is that some packages will not be added automatically.


2.1. SEARCHING FOR MISSED PACKAGES
root # pkg_info -qoa > /root/packagelist.NEW
root # diff -u /root/packagelist*

This way is probable the fastest and easiest to find missed packages.


3. CLEANUP
root # rm -r -f /root/packagelist*
root # rm -r -f /root/ETC.tar.gz

If we had made some bigger changes in the configuration, we may keep the old configuration (/root/ETC.tar.gz).

__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote