How do I install FreeBSD kernel source code?

by on June 30, 2007 · 8 comments· LAST UPDATED June 30, 2007

in

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
sysinstall-1.jpg

Select Configure
sysinstall-2.jpg
Select Distributions
sysinstall-3.jpg
Select src
sysinstall-4.jpg
Then base and sys > Select ok
sysinstall-5.jpg

Further readings

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 8 comments… read them below or add one }

1 SIFE September 17, 2009 at 11:41 pm

Salamo Alikom
does any way to get it with cvs ?

Reply

2 Cristian Navalici October 6, 2009 at 4:57 pm

Thanks a lot for the information!
It was helpful

Reply

3 Dask January 29, 2010 at 5:56 pm

tnks man!
It really help me!

Reply

4 Ben February 11, 2010 at 12:26 pm

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?

Reply

5 Ben February 11, 2010 at 12:38 pm

actually, need to:

# sysinstall
configure
options

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

Reply

6 sateesh June 30, 2012 at 6:04 pm

how do I install sources using pkg_add

Reply

7 bsd newbie August 22, 2012 at 6:11 pm

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

Reply

8 nixkid November 27, 2012 at 7:51 pm

Sysinstall is mostly dead. It won’t install the source distribution for you any more. But now you can solve this problem in the Howto forum: http://forums.freebsd.org/showthread.php?t=29172.

Reply

Leave a Comment

Tagged as: , , , ,

Previous Faq:

Next Faq: