Skip to content

FreeBSD Snippets

Terminal window
# Check or install pkg
pkg
# Find a package
pkg search curl
# Read the manual page for pkg install
pkg help install
# Update the local package repositories catalogues for the Latest branch:
pkg update -f
# Install a package like curl and confirm (-y)
pkg install -y curl
# Install a package as regular user with doas
doas pkg install ghostty
# Remove a package
pkg remove curl
# Upgrade a package
pkg upgrade <pkgname>
# Upgrade all available packages
pkg upgrade
# Audit packages for vulnerabilities
pkg audit -F
# Update ports repository as needed
git -C /usr/ports pull

See FreeBSD virtual machine provisioning scripts at Justin Tung / DevOps Tests - GitLab

Terminal window
# Get root access
su

Follow Chapter 2. Installing FreeBSD | FreeBSD Documentation Portal

  • Use freebsd installer
  • Use defaults
  • Add local user to wheel group to give them administrative access