PACKAGE SET
Choose a known base.
NetBSD 10.0 / amd64. CHECK_OSABI and CHECK_OS_VERSION are disabled for minor-release compatibility.
Important. Run install and upgrade commands from a root shell. The install kit replaces any existing /usr/pkg, /var/db/pkg, and /var/db/pkgin state. Do not use it over an existing installation.
01
NetBSD / amd64
All packages are signed; VERIFIED_INSTALLATION=always is configured.
Install
# Prerequisite: run this block from a root shell.
BOOTSTRAP_TAR="bootstrap-netbsd-trunk-x86_64-20230918.tar.gz"
BOOTSTRAP_SHA="493161aa5dd4c91c99e77187fa9fc3498fd2560b"
# Download the bootstrap kit to the current directory.
ftp https://pkgsrc.smartos.org/packages/NetBSD/bootstrap/${BOOTSTRAP_TAR}
# Verify the SHA1 checksum before unpacking.
echo "${BOOTSTRAP_SHA} ${BOOTSTRAP_TAR}" | sha1 -c || exit 1
# Optional: verify the PGP signature (requires gpg).
# ftp https://pkgsrc.smartos.org/packages/NetBSD/bootstrap/${BOOTSTRAP_TAR}.asc
# curl -sS https://pkgsrc.smartos.org/pgp/C72658C9.asc | gpg2 --import
# gpg2 --verify ${BOOTSTRAP_TAR}.asc ${BOOTSTRAP_TAR}
rm -rf /usr/pkg /var/db/pkg /var/db/pkgin
# Unpack the kit to /usr/pkg.
tar -zxpf ${BOOTSTRAP_TAR} -C /
# Add pkgsrc tools to this shell.
PATH=/usr/pkg/sbin:/usr/pkg/bin:$PATHUpgrade this package set
Use an upgrade kit only when package configuration or signing keys need to change. For normal maintenance, run pkgin upgrade.
# Prerequisite: run this block from a root shell.
UPGRADE_TAR="bootstrap-netbsd-trunk-x86_64-20230918-upgrade.tar.gz"
UPGRADE_SHA="2af0899b2c77b59703b85a9c3ef52d31a84d2e41"
# Download the upgrade kit to the current directory.
ftp https://pkgsrc.smartos.org/packages/NetBSD/bootstrap-upgrade/${UPGRADE_TAR}
# Verify the SHA1 checksum before unpacking.
echo "${UPGRADE_SHA} ${UPGRADE_TAR}" | sha1 -c || exit 1
# Optional: verify the PGP signature (requires gpg).
# ftp https://pkgsrc.smartos.org/packages/NetBSD/bootstrap-upgrade/${UPGRADE_TAR}.asc
# curl -sS https://pkgsrc.smartos.org/pgp/C72658C9.asc | gpg2 --import
# gpg2 --verify ${UPGRADE_TAR}.asc ${UPGRADE_TAR}
# Unpack the kit to /usr/pkg.
tar -zxpf ${UPGRADE_TAR} -C /
# Ensure package tools and installed packages are current.
/usr/pkg/sbin/pkg_add -U pkg_install pkgin libarchive
/usr/pkg/bin/pkgin clean
/usr/pkg/bin/pkgin -y upgradePOST-INSTALL
Operate with pkgin.
pkgin is the binary package front end. The underlying pkg_add, pkg_info, pkg_create, and pkg_admin tools remain available when you need them.
# Run this block from a root shell.
# Refresh repository metadata
/usr/pkg/bin/pkgin -y update
# Find, install, and upgrade packages
/usr/pkg/bin/pkgin search ^ffmpeg[0-9]$
/usr/pkg/bin/pkgin -y install ffmpeg4
/usr/pkg/bin/pkgin avail
/usr/pkg/bin/pkgin -y upgrade
/usr/pkg/bin/pkgin -y remove ffmpeg4
/usr/pkg/bin/pkgin -y autoremove
# Inspect installed package metadata and files
/usr/pkg/sbin/pkg_info
/usr/pkg/sbin/pkg_info -Fe /usr/pkg/bin/ffmpeg4
/usr/pkg/sbin/pkg_info -qL ffmpeg4
# Refresh the vulnerability list and audit installed packages
/usr/pkg/sbin/pkg_admin fetch-pkg-vulnerabilities
/usr/pkg/sbin/pkg_admin audit