..and get an E-mail when it is done!
Okay, so you’ll see more than one line of code but here but the main thing is the single line with the make commands. As long as you are in /usr/src and run that you will probably be okay. Everything else is just recommended.
This is how I currently update world on FreeBSD. I recommend that you start a screen session before doing this. Let’s name our session “updating.”
screen -S updating
If you do not have screen I recommend installing it:
cd /usr/ports/sysutils/screen/ make install clean
If you haven’t updated the svn of the src, now is a good time to do it. If you have never downloaded src, here is how you check out a src repo for FreeBSD.
Now, let’s check the UPDATING file:
Check for any important news there first (the first couple entries should be enough if you’ve updated recently but you can always check your current patchlevel first with a uname -a).
Go to the src directory and check if anything needs to be updated it /etc before we update by running mergemaster with the -p flag. Often you can skip this step, especially if it is only a minor update.
cd /usr/src mergemaster -p
Then let’s rebuild and install everything in one line. Use your e-mail address instead at the end:
make -j4 buildworld && echo bw-done && \ make -j4 kernel && echo bkik-done && \ make -j4 installworld && echo iw-done && \ echo "install world done" | mail -s "iw done on $HOSTNAME" email@example.com
It will start running with text streaming by.
If you ran screen at the beginning type Ctrl+a and then type d to disconnect from the session.
I like this because I start it in a screen session and immediately detach.
Once I get the e-mail (or if it has been a while and I haven’t received anything) I reconnect.
When you want to reconnect to check on it or after it is done do:
screen -r updating
Once done if everything looks like it ran fine do this:
If you want to save some space after you are done
rm -r /usr/obj
Restart the machine and you should be updated!