how to bootstrap freebsd pkgng

mkdir -p /usr/local/etc/pkg/repos
cat << EOF > /usr/local/etc/pkg/repos/FreeBSD.conf
FreeBSD: {
  url: "${ABI}/latest",
  mirror_type: "srv",
  enabled: yes

That’s it, you should be able to use pkgng:

pkg update
pkg install sl # This is my favorite test package!

pkg may display an error message (only warning):

pkg: Invalid configuration format, ignoring the configuration file

This is a known bug related to the empty /usr/local/etc/pkg.conf file. pkg 1.2 should fix this problem.

w/o pkgng:

pkg_add <pkgname>
# or...
pkg_add -r <pkgname>