Skip to content


29 September 2021 - pkgsrc-2021Q3 released

The pkgsrc developers are proud to announce the pkgsrc-2021Q3 branch, the 72th pkgsrc release.

See the release announcement for more information.

28 June 2021 - pkgsrc-2021Q2 released

The pkgsrc developers are proud to announce the pkgsrc-2021Q2 branch, the 71th pkgsrc release.

See the release announcement for more information.

29 March 2021 - pkgsrc-2021Q1 released

The pkgsrc developers are proud to announce the pkgsrc-2021Q1 branch, the 70th pkgsrc release.

See the release announcement for more information.

07 January 2021 - pkgsrc-2020Q4 released

The pkgsrc developers are proud to announce the pkgsrc-2020Q4 branch, the 69th pkgsrc release.

See the release announcement for more information.

2 December 2020 - pkgsrc database directory changed on NetBSD

The pkgsrc default database location on NetBSD has changed from /var/db/pkg to /usr/pkg/pkgdb (${PREFIX}/pkgdb).

This does not affect other operating systems that already were set up using the bootstrap script. This script already defaulted to ${PREFIX}/pkgdb.

See the pkgdb-change wiki page for more details and how to adjust your system.

pkgsrc is a framework for managing third-party software on UNIX-like systems, currently containing over 17,900 packages. It is the default package manager of NetBSD and SmartOS, and can be used to enable freely available software to be built easily on a large number of other UNIX-like platforms. The binary packages that are produced by pkgsrc can be used without having to compile anything from source. It can be easily used to complement the software on an existing system.

pkgsrc is very versatile and configurable, supporting building packages for an arbitrary installation prefix, allowing multiple branches to coexist on one machine, a build options framework, and a compiler transformation framework, among other advanced features. Unprivileged use and installation is also supported.

NetBSD already contains the necessary tools for using pkgsrc; on other platforms you need to bootstrap pkgsrc to get the package management tools installed.

Table of contents:


install binary packages (NetBSD)

Set the PKG_PATH and install pkgin if it isn't installed already:

# PKG_PATH="$(uname -p)/$(uname -r|cut -f '1 2' -d.)/All/"
# export PKG_PATH
# pkg_add pkgin

pkgin is the primary high level tool for managing pkgsrc binary packages, designed to be familiar to users of other package managers such as apt:

# pkgin search nginx
nginx-1.19.6         Lightweight HTTP server and mail proxy server
nginx-1.18.0nb8      Lightweight HTTP server and mail proxy server
# pkgin install zsh nginx-1.19.6 vim
# pkgin upgrade

A browsable web index of NetBSD packages is available.

install binary packages (illumos, macOS, Enterprise Linux)

Binary package sets for illumos, macOS, and Enterprise Linux are available from Joyent.

install source packages

get pkgsrc

You can checkout pkgsrc HEAD with CVS:

$ CVS_RSH=ssh cvs checkout -P pkgsrc

Or pkgsrc's stable branch:

$ CVS_RSH=ssh cvs checkout -r pkgsrc-2021Q3 -P pkgsrc

Or download pkgsrc from HTTP:


On operating systems other than NetBSD, and on NetBSD with non-default settings (e.g. different installation PREFIX), pkgsrc first needs to bootstrap (build and install its tools).

$ cd pkgsrc/bootstrap
$ ./bootstrap --prefix /opt/pkg-2021Q3 --prefer-pkgsrc yes --make-jobs 4

build a package

Dependencies will be automatically downloaded, built, and installed.

$ cd pkgsrc/devel/memcached
$ bmake install clean

On a non-bootstrapped NetBSD installation, bmake is simply make.

Built packages can then be managed with exactly the same tools as binary packages (pkgin, pkg_info, etc).

Various tools exist to automate the building and installation of pkgsrc packages, including pbulk, pkg_chk, and pkg_rolling-replace.

start packaging yourself

Take a look at pkgsrc-wip if you want to contribute by packaging software yourself!

community and support

We use the NetBSD mailing lists pkgsrc-users and tech-pkg. If you don't want to subscribe, you can browse via web or NNTP, and post without a subscription. There is also a #pkgsrc IRC channel on the Libera IRC chat network.

If you want to report a bug, use the NetBSD bug reporting tool and select the pkg category.

There is a pkgsrc account on Twitter.

We used to have pkgsrcCon in the real world, but then the world ended.


For getting the latest package vulnerabilities database and checking your installed packages against it, use

# pkg_admin fetch-pkg-vulnerabilities
$ pkg_admin audit

The vulnerabilities database and package EOL database are both signed with the pkgsrc-security GPG key.

A hardening guide is also available.

supported platforms

primary focus

other supported platforms

information for developers

other links