OpenBSD install packets

Install Packages in OpenBSD:

#!/bin/ksh
# Author: Tancredi-Paul Grozav <paul@grozav.info>
# Date: 2016-03-01
# Package management
# Run with no parameters to see help

mirror="ftp.openbsd.org"
os_version="$(uname -r)"
architecture="$(uname -p)"
if [ "$1" == "install" ]; then
        PKG_PATH=ftp://$mirror/pub/OpenBSD/$os_version/packages/$architecture pkg_add $2
elif [ "$1" == "search" ]; then
        (sleep 0.5 ; echo cd pub/OpenBSD/$os_version/packages/$architecture ; echo "ls $2" ; sleep 0.5) | ftp ftp://$mirror/
else
        echo "Search for packagges: ./package search python-*"
        echo "Install package: ./package install python"
fi

Or, you could simply run this after boot: export PKG_PATH=http://ftp.eu.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(uname -p)

Shut down the operating system:halt -p

 

http://www.openbsd.org/faq/faq4.html