How to keep 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
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
)
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 CVSup Mirrors
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…
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
:
# 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'
FreeBSD has a few tools to help facilitate upgrading ports
packages. The two we will use are:
/usr/ports/ports-mgmt/portupgrade
/usr/ports/ports-mgmt/portaudit
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 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.
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)
# pkgdb -F
UPDATING
file to make sure there are no problems with your configuration and the updates:# vi /usr/ports/UPDATING
# portupgrade -ai
# portsclean -C