Obtaining kernel sources after installation

I need to have kernel sources installed in /usr/src, but I did not install them at the time my system was installed. I should have done so, since I have an Nvidia GPU. (12.2-RELEASE, amd64.) If someone has instructions that would save time as compared to repeating the installation, I would appreciate it.
 
This appears to populate /usr/src:
svnlite checkout https://svn.freebsd.org/base/releng/12.2 /usr/src
Shortly I'll know if it's what I need.
 
For initial download is faster to download the archive of src.txz and extract it. Then you can use svnlite or freebsd-update for updating the src

for 12.2-RELEASE , amd64
cd /tmp
fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/12.2-RELEASE/src.txz
tar -C / -zxvf src.txz
rm /tmp/src.txz
 
Back
Top