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
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 8 comments… read them below or add one }
Salamo Alikom
does any way to get it with cvs ?
Thanks a lot for the information!
It was helpful
tnks man!
It really help me!
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?
actually, need to:
# sysinstall
configure
options
then change the release name to 8.0-RELEASE and it works fine after that.
how do I install sources using pkg_add
Thanks. It’s very helpful. I have been benefiting from your website. Keep up the good work. :D
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.