OpenBSD install the source code in /usr/src

Fig.01: Grab the source code in /usr/src

Fig.01: Grab the source code in /usr/src

To keep your system up to date. Grab the source code src.tar.gz and sys.tar.gz using the following command for the latest stable 5.9:

### define your base url ###
BASE="http://ftp3.usa.openbsd.org/pub/OpenBSD"

### define your version ##
VER="5.9"

### Grab the source code ###
ftp ${BASE}/${VER}/src.tar.gz \
${BASE}/${VER}/sys.tar.gz \
${BASE}/${VER}/SHA256.sig


Sample outputs:

Trying 192.43.244.161...
Requesting http://ftp3.usa.openbsd.org/pub/OpenBSD/5.9/src.tar.gz
100% |***********************************************|   120 MB    00:22    
126370631 bytes received in 22.14 seconds (5.44 MB/s)
Trying 192.43.244.161...
Requesting http://ftp3.usa.openbsd.org/pub/OpenBSD/5.9/sys.tar.gz
100% |***********************************************| 19936 KB    00:05    
20414597 bytes received in 5.70 seconds (3.42 MB/s)
Trying 192.43.244.161...
Requesting http://ftp3.usa.openbsd.org/pub/OpenBSD/5.9/SHA256.sig
100% |***********************************************|  1028       00:00    
1028 bytes received in 0.59 seconds (1.70 KB/s)


Verify it:
# signify -C -p /etc/signify/openbsd-59-base.pub -x SHA256.sig src.tar.gz
Signature Verified
src.tar.gz: OK


# signify -C -p /etc/signify/openbsd-59-base.pub -x SHA256.sig sys.tar.gz
Signature Verified
sys.tar.gz: OK

#

Finally untar both files, run:
# tar xzf src.tar.gz
# tar xzf sys.tar.gz
# rm *.tar.gz SHA256.sig

And there you have it, source code downloaded, verified and installed on OpenBSD 5.9.

Examples and usage: How to apply patches on OpenBSD system/kernel and packages easily