Forge Home


PkgNG package provider for FreeBSD


192 latest version

4.7 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 4.1.0 (latest)
  • 4.0.0
  • 3.0.0
  • 2.4.0
released Nov 6th 2023
This version is compatible with:
  • Puppet Enterprise 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppet-pkgng', '4.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppet-pkgng
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppet-pkgng --version 4.1.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.



puppet/pkgng — version 4.1.0 Nov 6th 2023


Build Status Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores

The package provider that matured in this repository has been merged upstream into the core Puppet package providers. As of puppet 4.1, you can enjoy the fruits of the pkgng provider without this module. This module now remains to manage pkg.conf, extra package repositories etc.

If you are looking to build your own PkgNG packages, you may also want to look at the poudriere module.

Upgrading Requirements

To use the 1.x or newer version of this module, ensure that you are running Puppet 4.1 or higher. Any of the pkgng_* facts that were employed outside of this repository should be re-evaluated. Those facts are no longer distributed with this module.

If you are using a Package override to specify that pkgng should be used as the provider, this should no longer be required as the pkgng provider is now the default for FreeBSD.

The latest release of this module to contain the package provider is 0.4.0.


The easiest way to install is to install from the forge.

puppet module install puppet/pkgng

Then to configure your system to use PkgNG with all default settings, a simple include will do.

include pkgng

You may wish to override settings though, to do this simply use it as a class:

class { 'pkgng':
  purge_repos_d => false,
  options       => [
    'PKG_ENV : {',
    ' http_proxy: "http://proxy:3128"',

By default, this module will erase user-defined repository not managed by Puppet. To disable this behaviour you can use the example above of setting purge_repos_d to false.

Disabling the FreeBSD default repository is done with:

pkgng::repo { 'FreeBSD':
  enabled => false,

Using specific repositories is as simple as a Puppet resource.

pkgng::repo { '': }  # You'll want this one!
pkgng::repo { 'my.own.repo': }      # You can then specify more...

Installation via R10K

You can also clone this repo to somewhere in your modulepath, or use something like r10k to deploy your modules. R10k is sweet. For those not familiar, check out Finch's blog post on the subject of module deployment.

To track the git repository, a line in your Puppetfile that looks something like the following should get you started.

mod 'pkgng', :git => 'git://', :ref => '1.0.0'

Installation via Librarian-Puppet

Installation via Librarian-Puppet is straight forward, simply add the following to your Puppetfile

mod 'zleslie/pkgng'


Once the module is installed, you can simply install package resources.

package { 'curl': }

With multiple repositories defined, a package can be installed from a specific repo by giving a URN locator for that repository like this.

pkgng::repo { 'my.own.repo': }

package { 'puppet':
  source => 'urn:freebsd:repo:my.own.repo',

If you have multiple repos providing the same package you can prefer one repo over the other by increasing the priority. The default priority is 0 and higher priorities are preferred.

pkgng::repo { '': }
pkgng::repo { 'my.own.repo':
  priority => 10,

package {'curl': }

With the above config if the 'curl' package exists in both repositories it would be installed from my.own.repo


Please help make this module better. Send pull request, file issues, be mindful of the tests and help improve where you can.

For any provider changes, please submit those directly to core Puppet.


Thanks to all contributors who helped mature the provider and helped it graduate from this module into core Puppet. Its maintenance will also require community attention.