pkgsrc logo

Portable Package Management

pkgsrc is a framework for building over 17,000 open source software packages. It is the native package manager on SmartOS, NetBSD, and Minix, and is portable across 23 different operating systems. Use one package manager across all of your systems!

Joyent provide binary packages for SmartOS/illumos, Mac OS X, and Linux.


Screenshots

These example screenshots show just a small number of the 14,000+ binary packages available in our 64-bit pkgsrc set. All examples were produced on a clean install of OS X El Capitan (10.11.4) inside VMware Fusion.

pkgsrc XFCE 4.12 on OSX

XFCE 4.12 / Gnumeric / Inkscape

pkgsrc apps on OSX

GIMP / XChat

Installing pkgsrc nodejs on OSX

Installing Node.js

Running pkgsrc jekyll on OSX

Installing and running Jekyll (Ruby 2.3 version)

Choose Your OS X Package Set

Packages for Mac OS X are offered in two different configurations, a 64-bit set built on Mavericks suitable for users running 10.9 or newer (recommended), and a 32-bit set built on Snow Leopard suitable for users still running legacy OS X releases on 32-bit hardware. Both sets are built from pkgsrc trunk and are updated with the latest packages every few days.

64-bit set built on OS X Mavericks (10.9) using clang-600.0.56. Use this set unless you specifically need packages built for an older release or do not have 64-bit hardware.

#
# Copy and paste the lines below to install the 64-bit 10.9+ set.
#
BOOTSTRAP_TAR="bootstrap-trunk-x86_64-20161011.tar.gz"
BOOTSTRAP_SHA="09d6649027ce12cadf35a47fcc5ce1192f40e3b2"

# Download the bootstrap kit to the current directory.
curl -O https://pkgsrc.joyent.com/packages/Darwin/bootstrap/${BOOTSTRAP_TAR}

# Verify the SHA1 checksum.
echo "${BOOTSTRAP_SHA}  ${BOOTSTRAP_TAR}" >check-shasum
shasum -c check-shasum

# Verify PGP signature.  This step is optional, and requires gpg.
curl -O https://pkgsrc.joyent.com/packages/Darwin/bootstrap/${BOOTSTRAP_TAR}.asc
gpg --recv-keys 0x1F32A9AD
gpg --verify ${BOOTSTRAP_TAR}{.asc,}

# Install bootstrap kit to /opt/pkg
sudo tar -zxpf ${BOOTSTRAP_TAR} -C /

# Reload PATH/MANPATH (pkgsrc installs /etc/paths.d/10-pkgsrc for new sessions)
eval $(/usr/libexec/path_helper)

32-bit set built on OS X Snow Leopard (10.6) using GCC 4.2.1. Use this set only if you are running an OS X release prior to Mavericks (10.9) or do not have 64-bit hardware.

#
# Copy and paste the lines below to install the 32-bit 10.6+ set.
#
BOOTSTRAP_TAR="bootstrap-trunk-i386-20160509.tar.gz"
BOOTSTRAP_SHA="e900f05c9f3aa8e2fb7ccee370467acf95f5df21"

# Download the bootstrap kit to the current directory.
curl -O https://pkgsrc.joyent.com/packages/Darwin/bootstrap/${BOOTSTRAP_TAR}

# Verify the SHA1 checksum.
echo "${BOOTSTRAP_SHA}  ${BOOTSTRAP_TAR}" >check-shasum
shasum -c check-shasum

# Verify PGP signature.  This step is optional, and requires gpg.
curl -O https://pkgsrc.joyent.com/packages/Darwin/bootstrap/${BOOTSTRAP_TAR}.asc
gpg --recv-keys 0x1F32A9AD
gpg --verify ${BOOTSTRAP_TAR}{.asc,}

# Install bootstrap kit to /opt/pkg
sudo tar -zxpf ${BOOTSTRAP_TAR} -C /

# Reload PATH/MANPATH (pkgsrc installs /etc/paths.d/10-pkgsrc for new sessions)
eval $(/usr/libexec/path_helper)

Use these sets to upgrade from a previous pkgsrc-2015Q[23] or trunk 64-bit install. If you are currently running a pkgsrc-2015Q1 or earlier release you will need to follow the full install instructions.

#
# If you are upgrading from pkgsrc-2015Q[23] then use this upgrade kit first.  This
# will switch you over to the trunk package repository.
#
UPGRADE_TAR="bootstrap-trunk-x86_64-20160509-upgrade.tar.gz"
UPGRADE_SHA="c86bcb09b1ee5facb40cc77d57d8ee877c85fe14"

#
# Otherwise if you are upgrading from a previous trunk release use this kit, which
# changes the repositories to fetch via HTTPS by default (requires pkgtools support).
#
UPGRADE_TAR="bootstrap-trunk-x86_64-20161011-upgrade.tar.gz"
UPGRADE_SHA="f24d12ed8b6fed0c372c77168133e8cebced13a9"

# Download the upgrade kit to the current directory.
curl -O https://pkgsrc.joyent.com/packages/Darwin/bootstrap-upgrade/${UPGRADE_TAR}

# Verify the SHA1 checksum.
echo "${UPGRADE_SHA}  ${UPGRADE_TAR}" >check-shasum
shasum -c check-shasum

# Verify PGP signature.  This step is optional, and requires gpg.
curl -O https://pkgsrc.joyent.com/packages/Darwin/bootstrap-upgrade/${UPGRADE_TAR}.asc
gpg --recv-keys 0x1F32A9AD
gpg --verify ${UPGRADE_TAR}{.asc,}

# Ensure you are running the latest package tools.
sudo pkg_add -U pkg_install pkgin

# Unpack bootstrap upgrade kit over /opt/pkg
sudo tar -zxpf ${UPGRADE_TAR} -C /

# Re-install the package tools again in case the repository changed.
sudo pkg_add -U pkg_install pkgin

# Upgrade all packages.
sudo pkgin full-upgrade

#
# When upgrading from an older pkgsrc-2015Q[23] install there is a small
# chance that there may be some packages which still have references to
# Xquartz from /opt/X11.  The trunk packages use Xquartz from pkgsrc, so
# to ensure the newer versions are installed use this command.
#
for pkg in $(pkg_info | awk '{print $1}'); do
  pkg_info -Q REQUIRES ${pkg} | grep '^/opt/X11' >/dev/null 2>&1 && echo ${pkg}
done | xargs pkgin -Fy install

Use these sets to upgrade from a previous pkgsrc-2015Q[23] or trunk 32-bit install. If you are currently running a pkgsrc-2015Q1 or earlier release you will need to follow the full install instructions.

#
# Copy and paste the lines below to upgrade to the latest 32-bit set.
#
UPGRADE_TAR="bootstrap-trunk-i386-20160509-upgrade.tar.gz"
UPGRADE_SHA="264ccde9985698defcf8db808c543d68eb10217d"

# Download the upgrade kit to the current directory.
curl -O https://pkgsrc.joyent.com/packages/Darwin/bootstrap-upgrade/${UPGRADE_TAR}

# Verify the SHA1 checksum.
echo "${UPGRADE_SHA}  ${UPGRADE_TAR}" >check-shasum
shasum -c check-shasum

# Verify PGP signature.  This step is optional, and requires gpg.
curl -O https://pkgsrc.joyent.com/packages/Darwin/bootstrap-upgrade/${UPGRADE_TAR}.asc
gpg --recv-keys 0x1F32A9AD
gpg --verify ${UPGRADE_TAR}{.asc,}

# Ensure you are running the latest package tools.
sudo pkg_add -U pkg_install pkgin

# Unpack bootstrap upgrade kit over /opt/pkg
sudo tar -zxpf ${UPGRADE_TAR} -C /

# Re-install the package tools again in case the repository changed.
sudo pkg_add -U pkg_install pkgin

# Upgrade all packages.
sudo pkgin full-upgrade

#
# When upgrading from an older pkgsrc-2015Q[23] install there is a small
# chance that there may be some packages which still have references to
# Xquartz from /opt/X11.  The trunk packages use Xquartz from pkgsrc, so
# to ensure the newer versions are installed use this command.
#
for pkg in $(pkg_info | awk '{print $1}'); do
  pkg_info -Q REQUIRES ${pkg} | grep '^/opt/X11' >/dev/null 2>&1 && echo ${pkg}
done | xargs pkgin -Fy install

Post-Install Steps

Now that you're ready to go, here are some common commands you may want to run.

Use pkgin to install packages

pkgin is the front-end to the binary packages, and lets you search for, install, upgrade, and remove packages. It also provides some basic functionality for querying both local and remote packages. If you have used apt-get or yum you should find it to be very familiar.

Use pkg_* tools to manage packages

The underlying packaging tools are pkg_add, pkg_admin, pkg_create, pkg_delete, and pkg_info. If pkgin is equivalent to apt-get or yum, then these are the equivalent of dpkg or rpm. Here are some useful commands to get you started.

: Refresh the pkgin database with the latest version
$ sudo pkgin -y update

: Search for a package.  Regular expressions are supported.
$ pkgin search "^ffmpeg[0-9]$"
ffmpeg3-3.0.1   Decoding, encoding and streaming software (v3.x)
ffmpeg2-2.8.6   Decoding, encoding and streaming software (v2.x)
ffmpeg1-1.2.12  Decoding, encoding and streaming software (v1.x)

: Install a package without prompting
$ sudo pkgin -y install ffmpeg3

: List all available packages
$ pkgin avail

: Upgrade all out-of-date packages
$ sudo pkgin -y full-upgrade

: Remove a package
$ sudo pkgin -y remove ffmpeg2

: Automatically remove orphaned dependencies
$ sudo pkgin -y autoremove
: See what packages are installed.
$ pkg_info

: See what package a file belongs to.
$ pkg_info -Fe /opt/pkg/bin/node
nodejs-4.4.3

: List the contents of a package.
$ pkg_info -qL nodejs
/opt/pkg/bin/node
/opt/pkg/bin/npm
[...]

: Perform an audit of all currently installed packages.
$ sudo pkg_admin fetch-pkg-vulnerabilities
$ pkg_admin audit
Package jasper-1.900.1nb11 has a integer-overflow vulnerability, see http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-3520
Package samba-3.6.25nb3 has a privilege-escalation vulnerability, see https://www.samba.org/samba/security/CVE-2015-5299.html
Package tiff-4.0.6 has a arbitrary-memory-access vulnerability, see http://www.securityfocus.com/archive/1/537205
[...]

: Create a binary package from some metadata files and package directory.
$ pkg_create -B build-info -c comment -d description -f packlist -I /opt/pkg -p files/ -U foo-1.0.tgz