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 ...)
[font="Courier New"]root # tar -czf /root/ETC.tar.gz /etc /usr/local/etc[/font]
1. BASE SYSTEM UPGRADE (I assume that 8.1-RELEASE is the current latest version)
[font="Courier New"]root # freebsd-update upgrade -r 8.1-RELEASE[/font]
[font="Courier New"]root # freebsd-update install[/font]
[font="Courier New"]root # shutdown -r now[/font]
[font="Courier New"]root # freebsd-update install[/font]
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
[font="Courier New"]root # pkg_info -qoa | sort > /root/packagelist[/font]
[font="Courier New"]root # pkg_delete -a -f[/font]
[font="Courier New"]root # rm -r -f /boot/modules /usr/local /var/db/pkg[/font]
[font="Courier New"]root # while read PKG; do pkg_add -r $( basename ${PKG} ); done < /root/packagelist[/font]
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
[font="Courier New"]root # pkg_info -qoa | sort > /root/packagelist.NEW[/font]
[font="Courier New"]root # diff -u /root/packagelist*[/font]
This way is probably the fastest and easiest to find missed packages.
3. CLEANUP
[font="Courier New"]root # rm -r -f /root/packagelist*[/font]
[font="Courier New"]root # rm -r -f /root/ETC.tar.gz[/font]
If we had made some bigger changes in the configuration, we may keep the old configuration (/root/ETC.tar.gz).
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 ...)
[font="Courier New"]root # tar -czf /root/ETC.tar.gz /etc /usr/local/etc[/font]
1. BASE SYSTEM UPGRADE (I assume that 8.1-RELEASE is the current latest version)
[font="Courier New"]root # freebsd-update upgrade -r 8.1-RELEASE[/font]
[font="Courier New"]root # freebsd-update install[/font]
[font="Courier New"]root # shutdown -r now[/font]
[font="Courier New"]root # freebsd-update install[/font]
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
[font="Courier New"]root # pkg_info -qoa | sort > /root/packagelist[/font]
[font="Courier New"]root # pkg_delete -a -f[/font]
[font="Courier New"]root # rm -r -f /boot/modules /usr/local /var/db/pkg[/font]
[font="Courier New"]root # while read PKG; do pkg_add -r $( basename ${PKG} ); done < /root/packagelist[/font]
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
[font="Courier New"]root # pkg_info -qoa | sort > /root/packagelist.NEW[/font]
[font="Courier New"]root # diff -u /root/packagelist*[/font]
This way is probably the fastest and easiest to find missed packages.
3. CLEANUP
[font="Courier New"]root # rm -r -f /root/packagelist*[/font]
[font="Courier New"]root # rm -r -f /root/ETC.tar.gz[/font]
If we had made some bigger changes in the configuration, we may keep the old configuration (/root/ETC.tar.gz).