Web www.freebsdmadeeasy.com
Main Menu

Updating FreeBSD with Make World

When a new version of FreeBSD is released, or there have been a number of security updates released it is necessary to update FreeBSD with Make World. The process may seem very complex if you have never done one before, but overall it is very straight forward and painless.

Step 1. Getting the new source

To see how to download the most recent source see the Cvsup Tutorial.

Step 2. Building the new world

This step is not necessary since the world will be automatically built when you do the install, if it has not been built already. The reason for running this command seperately is so that it can run while the machine is running normally instead of running while the machine is in single user mode. Running it seperately also allows you to fix any errors that occured before installing the world.

# cd /usr/src
# make buildworld

The time buildworld takes varies greatly depending on the speed of the machine. On a 90mhz machine it could take up to 24 hours, where as on a 3ghz machine the time would be under 45 minutes.

If you experience problems during the buildworld you need to run the follow commands to clean up so you can start over

# cd /usr/obj
# chflags -R noschg *
# rm -rf *

Step 3. Recompiling the Kernel

The kernel needs to be using the same source as the new world or strange things will happen. To do this see the building a new kernel tutorial

Step 4. Installing the new world

The new world should be installed with as little else running as possible, so booting into single user mode is the best way. To do this reboot and either choose boot into single user mode from the menu in 5.x or hit space during the 10 second count down at boot and type

boot -s

Hit enter to choose /bin/sh as your shell and then enter the following commands to mount the needed drives and add swap space.

# mount -u /
# mount -a -t ufs
# swapon -a

Now you are ready to install the new world.

# cd /usr/src
# make installworld

Step 5. Merging the config file

Some updates to the source require updates to the config files in /etc. It is a good idea to back up your /etc directory. Once you have done this run mergemaster

# mergemaster -v

Mergemaster will compare the new etc files to what you have in /etc. It will present any differences to you and ask if you want to merge, skip, or just install the new file. For the most part you should install the new version of every file unless it is a file that you know you have editted such as make.conf, rc.conf, or master.passwd.

After you have finished merging the etc files you can reboot back into multi-user mode.

Performing a Make World remotely.

Although it is not recommended a make world can be done remotely. You just need to kill every unnecessary process and be really careful since if there is a problem the machine will not come back online after the reboot.