Updating FreeBSD

Information

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

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 CVSup Mirrors

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:

  1. `cd /usr/src' (or to the directory containing your source tree).
  2. `make buildworld'
  3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
  4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
  5. `reboot' (in single user mode: boot -s from the loader prompt).
  6. `mergemaster -p'
  7. `make installworld'
  8. `make delete-old'
  9. `mergemaster'
  10. `reboot'
  11. `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)
  1. Repair any inconsistencies in the packages database (and fix them):
    # pkgdb -F
  2. Check the UPDATING file to make sure there are no problems with your configuration and the updates:
    # vi /usr/ports/UPDATING
  3. Interactively check for outdated packages, and pick which ones to update:
    # portupgrade -ai
  4. After you have updated your outdated ports, delete any temporary work directories:
    # portsclean -C
freebsd/updating_freebsd.txt · Last modified: 2007/10/05 04:18 by john
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki