Published : 2014-11-11

Pkgng configuration migration

Following a recent update of pkgng (version 1.2), the previous repository declaration format has been removed. As a reminder, to use the packages from a repository, you used to edit /usr/local/etc/pkg.conf and add a line like this:

packagesite: http://repository.unix-experience.fr/FreeBSD/9.1/packages

From now on, you need two things:

  • An SRV record for your repository.
  • A repository-specific configuration file.

For the SRV record, you need the following entry:

_http._tcp.repository.unix-experience.fr 10 10 80 repository.unix-experience.fr

For the configuration, you first need to create a directory dedicated to repository configurations:

mkdir -p /usr/local/etc/pkg/repos/

Then create a configuration file for your repo (for example /usr/local/etc/pkg/repos/myrepo.conf):

MYREPO: {
  url: "pkg+http://repository.unix-experience.fr/FreeBSD/9.1/packages",
  mirror_type: "srv",
  signature_type: "none",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}

You now have a working repository configuration file.