OpenBSD packages can have different flavors (build options):
from pyinfra.operations import pkg# Install vim without X11 supportpkg.packages( name="Install vim without X11", packages=["vim--no_x11"],)# Install python with different versionpkg.packages( name="Install Python 3.11", packages=["python%3.11"],)
Finding the Right PKG_PATH
To find the correct PKG_PATH for your system:OpenBSD:
# Check /etc/installurl or use:http://ftp.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(uname -m)/
from pyinfra.operations import server# FreeBSDserver.shell( name="Show package info", commands=["pkg info nginx"],)# OpenBSD/NetBSDserver.shell( name="Show package info", commands=["pkg_info nginx"],)
Updating Package Database
Update package repositories:
from pyinfra.operations import server# FreeBSDserver.shell( name="Update package database", commands=["pkg update"],)# OpenBSD doesn't have a separate update command# NetBSDserver.shell( name="Update pkgin database", commands=["pkgin update"], # if using pkgin)
Searching for Packages
Search for available packages:
from pyinfra.operations import server# FreeBSDserver.shell( name="Search for packages", commands=["pkg search nginx"],)# OpenBSDserver.shell( name="Search for packages", commands=["pkg_info -Q nginx"],)