====== Updating FreeBSD ====== ===== Information ===== How to keep [[http://www.freebsd.org|FreeBSD]] updated (primarily for sparc64) It seems like CVSup is the primary tool to use and porteasy is to keep ports up-to-date On x86 and x86-64 systems, one can use freebsd-update ===== Proceedure ===== Use ''csup'' or ''cvsup'' to update the local source (I am running on a sparc64 processor, and updates are not built for that platform. If you use x86 or x86-64, you can use ''freebsd-update'') ==== Configure supfile ==== First we have to configure the supfile(s) for ''csup'' to use. For my first try, I'm using the examples provided in ''/usr/share/examples/cvsup/'' # mkdir /etc/csup # cd /usr/share/examples/cvsup # cp standard-supfile ports-supfile /etc/csup/ And now you have to specify the update server in each of those files. I used ''cvsup3.us.freebsd.org'' from [[http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html#CVSUP-MIRRORS|CVSup Mirrors]] [[http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html|detailed CVSup information]] ==== Update Your Sources ==== Now that ''csup'' is configured, we can update our local sources: # cd /etc/csup # csup standard-supfile ... # csup ports-supfile These two commands might take a while... ==== Upgrade System Files ==== Need to update this instructions with tips from: [[http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html]] Once ''csup'' is complete, we can upgrade our system (for general bug-fixes and security updates - this does not update ''ports''): # cd /usr/src # make buildworld ... # make installworld Alternately, you can do those two steps at the same time with a target of ''world'': # cd /usr/src # make world Depending on the number of updates, this could take a looong while... After you've installed all the updates, you should clean the src directory: # cd /usr/src # make clean From ''/usr/src/Makefile'': - `cd /usr/src' (or to the directory containing your source tree). - `make buildworld' - `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). - `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). - `reboot' (in single user mode: boot -s from the loader prompt). - `mergemaster -p' - `make installworld' - `make delete-old' - `mergemaster' - `reboot' - `make delete-old-libs' (in case no 3rd party program uses them anymore) # make delete-old >>> Removing old files (only deletes safe to delete libs) >>> Old files removed >>> Removing old directories >>> Old directories removed To remove old libraries run '/usr/obj/usr/src/make.sparc64/make delete-old-libs' ==== Upgrade Ports ==== FreeBSD has a few tools to help facilitate upgrading ''ports'' packages. The two we will use are: * portupgrade - located in ''/usr/ports/ports-mgmt/portupgrade'' * portaudit - located in ''/usr/ports/ports-mgmt/portaudit'' === portupgrade === So, first we will build portupgrade (which also installs ruby, perl, and berkeley db): # cd /usr/ports/ports-mgmt/portupgrade # make install clean ... ===> Cleaning for ruby-1.8.6_2,1 ===> Cleaning for ruby18-bdb-0.6.0 ===> Cleaning for perl-5.8.8 ===> Cleaning for db41-4.1.25_4 ===> Cleaning for portupgrade-2.3.1,2 # exit ... log back in as root ... # pkgdb -F Once portupgrade is built, you will have to logout and log back in to be able to use it (without specifying the full path) === portaudit === portaudit will check for known security vulnerabilities automatically once installed. # cd /usr/ports/ports-mgmt/portaudit # make install clean ... ===> To check your installed ports for known vulnerabilities now, do: /usr/local/sbin/portaudit -Fda Since we've already installed a few things, lets check for vulnerabilities: # /usr/local/sbin/portaudit -Fda auditfile.tbz 100% of 43 kB 114 kBps New database installed. Database created: Sun Aug 5 23:10:02 EDT 2007 0 problem(s) in your installed packages found. === procedure === To list outdated ports, run ''pkg_version -v'': # pkg_version -v db41-4.1.25_4 = up-to-date with port perl-5.8.8 = up-to-date with port portupgrade-2.3.1,2 = up-to-date with port ruby-1.8.6_2,1 = up-to-date with port ruby18-bdb-0.6.0 = up-to-date with port vim-lite-7.0.94 < needs updating (port has 7.1.39) - Repair any inconsistencies in the packages database (and fix them):\\ # pkgdb -F - Check the ''UPDATING'' file to make sure there are no problems with your configuration and the updates:\\ # vi /usr/ports/UPDATING - Interactively check for outdated packages, and pick which ones to update:\\ # portupgrade -ai - After you have updated your outdated ports, delete any temporary work directories:\\ # portsclean -C ===== Reference Links ===== * [[http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html]] * [[http://www.onlamp.com/pub/a/bsd/2004/08/26/FreeBSD_Basics.html?page=2]] * [[http://www.onlamp.com/pub/a/bsd/2004/11/11/FreeBSD_Basics.html]] * [[http://www.bsdguides.org/guides/freebsd/beginners/update_freebsd.php]] == \\ \\ {{tag>:freebsd}}