# how do i install /usr/src ?  (ghostbsd does not install it)



## debguy (Oct 16, 2017)

i cannot find anything in handbook, noting handbook assumes bsdinstall did install /usr/src i think.

i'm running GhostBSD11.1-ALPHA1-20170808-063724-xfce-i386.iso

$ freebsd-version -k
11.1-RC3

i heard rumor: $ git clone https://github.com/freebsd/freebsd.git /usr/src
but i don't like that because Handbook says use svn.

what do i use to get /usr/src so i can compile (ie, lsof, which says kernel source must be installed)


----------



## tobik@ (Oct 16, 2017)

debguy said:


> i heard rumor: $ git clone https://github.com/freebsd/freebsd.git /usr/src
> but i don't like that because Handbook says use svn.


That's totally fine.



debguy said:


> what do i use to get /usr/src so i can compile (ie, lsof, which says kernel source must be installed)


Be very careful that you checkout the correct branch for the FreeBSD version you're running then. lsof can't work correctly if there is a mismatch.  I don't think there is a Git tag for 11.1-RC3 though, so maybe use releng/11.1 and see if that works.

`git clone -b releng/11.1 --single-branch https://github.com/freebsd/freebsd.git /usr/src`


----------



## SirDice (Oct 16, 2017)

debguy said:


> i'm running GhostBSD11.1-ALPHA1-20170808-063724-xfce-i386.iso


PC-BSD, FreeNAS, NAS4Free, and all other FreeBSD Derivatives


----------



## debguy (Oct 16, 2017)

> be careful ... lsof can't work correctly if there is a mismatch

I DID,  AND IT WAS.  it was broken, sqlite version mismatch, i think it was in the future.  i quite git because handbook didn't mention it (? not blessed by freebsd?), i tried using svn as per handbook (forgetting that  "portsnap fetch" would be easier), i couldn't get any of /usr/src using svn.  i'm forgetting RC3 i'm too new to find what/where it is and do all the right svn stuff (though i know cvs and rcs fully).

When I found that out, got nervous i was in some OS that tangles paths to upgrade, so installed "normal 11.x" off freebsd.org site.

I figured as a new bsd user (old linux user) I can install X easier than i can tangle with bsd's update system "working as intended"

I'm guessing I should have used "portsnap fetch" and that might have worked, given the "situation".


----------



## tobik@ (Oct 17, 2017)

debguy said:


> I DID, AND IT WAS. it was broken, sqlite version mismatch, i think it was in the future.


Hmm, I don't understand. lsof doesn't use sqlite.


debguy said:


> not blessed by freebsd?


https://github.com/freebsd/freebsd is the official Git mirror of the FreeBSD source tree.


debguy said:


> I'm guessing I should have used "portsnap fetch" and that might have worked, given the "situation".


You cannot use portsnap(8) to download the FreeBSD source tree. As the name implies it's only for downloading a snapshot of the ports tree.

I think this thread needs a mention of procstat(1) which is in the base system and provides a lot of the information that lsof provides, but is a FreeBSD native tool instead of being a port of a Linux utility.


----------

