Donation from Maigurs Stalidzans. Thanks!
[ikiwiki.git] / docs / handbook / Upgrading / index.mdwn
1 ## Updating the System 
2
3 ### Supported methods
4
5 The only **supported** method of upgrading DragonFly BSD is by building from source code. The supported upgrade process includes going from the *previous release* to *latest release*.
6
7 ### Getting the source code
8
9 There is a Makefile in /usr which will ease the task of retrieving the source tree; it needs to be run as root:
10
11     # cd /usr
12     # make src-create
13      [...]
14
15 This will check out (download) the source tree to `/usr/src` and switch to the master branch. For the stable branch, you need to check it out with the following command (remember to replace the *DragonFly_RELEASE_X_X* with the appropriate branch name for the release needed).
16
17     % cd /usr/src
18     % git checkout DragonFly_RELEASE_X_X
19
20 To see the available remote branches:
21
22     # cd /usr/src 
23     # git pull
24     # git branch -r
25
26 The leading edge (development trunk) version of the system will be the "master".
27
28 ### Build and upgrade process
29
30 The build process requires some time to build all the userland programs and the DragonFly BSD kernel. Once built, all remaining steps tend to go pretty quickly.  No configuration files in */etc* are changed by this process. More details can be found in [build(7)](http://leaf.dragonflybsd.org/cgi/web-man?command=build&section=7) manpage. 
31
32     % cd /usr/src
33     % make build-all
34     % make install-all
35     % sync  
36     % reboot
37
38 If your computer fails to boot the new kernel, you can always select 'Boot DragonFly using kernel.old' in the loader menu, so that the old kernel is loaded instead of the new one.  The 'sync' is not required, but its usually a good idea (me putting my sysadmin hat on), just to make sure the filesystem is flushed before any
39
40 Once you have rebooted, if you built a major release change from your current release, you probably need to completely upgrade your packages, which you do as follows.  Its usually a good idea to reboot once more afterwords, and make sure everything works as intended.  When doing a major release change, the pkg upgrade operation will probably have to download all the packages so this will depend on your network speed.
41
42     % pkg upgrade -f
43     % sync
44     % reboot
45
46 Additional upgrading instructions can be found in */usr/src/UPDATING* in the source tree. They can also be found [online](http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/master:/UPDATING).