How to download FreeBSD source using svn?

If you want to compile a custom FreeBSD kernel or rebuild world or be a developer for FreeBSD, you may want to download the source.

Download FreeBSD Source as follows.

Step 1 – Install Subversion

Install subversion from ports or as a package.

From ports

# cd /usr/ports/devel/subversion
# make install

From packages

# pkg_add -r subversion

Note: Don’t forget to run ‘rehash’ if after install your current shell cannot find svn.

Step 2 – Check Out FreeBSD Source

To download FreeBSD source, use subversion. You may want to use Release, Stable, or Current. Release doesn’t have any updates, so if you want patches since release, you are likely wanting to do Release Engineering.


svn checkout /usr/src

Release Engineering

svn checkout /usr/src


# svn checkout /usr/src


# svn checkout /usr/src

You now have FreeBSD source and you should be able to compile the kernel or the FreeBSD world.


  1. grェ says:

    svnlite is in -CURRENT fwiw so you can now do:

    # svnlite co /usr/src

    To keep tracking -CURRENT

    This is useful insomuch as csup (and CVS) are deprecated at this point in -CURRENT, and there needed to be a suitable replacement in base.

  2. Josh says:

    Personally, I prefer to avoid dependencies, so I just use csup. csup is a C-based CVSup client, written by a nice guy (mux) I've chatted with on IRC--and it's in the base install:

    csup -zsh /usr/share/examples/cvsup/standard-cvsup

    That's all you need. For ports, replace standard-cvsup with ports-cvsup.

  3. [...] How to download FreeBSD source using svn? [...]

  4. [...] or FreeBSD-Stable using svn? Filed under: FreeBSD — rhyous @ 3:08 pm Read more Share this:DiggRedditLike this:LikeBe the first to like this post. Leave a [...]

  5. Robert Kopp says:

    When I ran this command in /usr/src
    $ svn checkout svn://
    it saved the source code in /usr/src/8. Now I want to base a buildworld on that source code, so it seems to me that mergemaster might require the -m /usr/src/8 switch. I'll have to try it and see, unless I hear from someone who already knows.

Leave a Reply

How to post code in comments?