How do I install FreeBSD kernel source code?

in Categories last updated June 30, 2007

Q. I need to configure FreeBSD kernel but not able to find out source code in /usr/src/sys directory. How do I install FreeBSD source code?

A.Your kernel and all related source code is located at /usr/src/sys directory which is also accessible through the /sys path.

If there is not a /usr/src/sys directory on your system, then the kernel source has not been installed. The easiest way to do this is by running sysinstall as root, choosing Configure, then Distributions, then src, then base and sys
# sysinstall

Select Configure
Select Distributions
Select src
Then base and sys > Select ok

Further readings

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Share this on (or read 8 comments/add one below):

8 comment

  1. followed these steps, but got:

    Warning: Can’t find the ‘8.0-RELEASE-p2’ distribution on this FTP server.

    I chose many different servers. What now?

  2. actually, need to:

    # sysinstall

    then change the release name to 8.0-RELEASE and it works fine after that.

  3. Thanks. It’s very helpful. I have been benefiting from your website. Keep up the good work. :D

    Have a question? Post it on our forum!