FreeBSD 10.0 will mark a turning point in its binary package management system. The legacy pkg_* tools will be removed and definitively replaced by pkgng.
Since pkgng was introduced, there was no mirror available to download and install these packages. That’s no longer the case. The FreeBSD team has announced the ability to use mirrors to download packages in binary form.
Unlike most Linux mirrors, FreeBSD (pkg_*) and OpenBSD, pkgng does not rely on a DNS A record.
The development team decided that using SRV records to manage pkg mirrors is more interesting, as it lets you manage the priority of each server.
So when pkg wants to reach http://pkg.FreeBSD.org/${ABI}/latest it will resolve the SRV record _http._tcp.pkg.freebsd.org and connect to one of the priority mirrors:
_http._tcp.pkg.freebsd.org. 60 IN SRV 10 10 80 pkg1.nyi.freebsd.org.
_http._tcp.pkg.freebsd.org. 60 IN SRV 10 10 80 pkg0.bme.freebsd.org.
_http._tcp.pkg.freebsd.org. 60 IN SRV 10 10 80 pkg0.isc.freebsd.org.
Note that the TTL of the record is 60 seconds, in order to balance the load as needed.
The mirrors support every version currently maintained by the FreeBSD team (8.3, 8.4, 9.1, 9.2, 10.0, and 11).
To switch to pkgng on 8.3 and 8.4, you’ll need to go through the ports:
cd /usr/ports/ports-mgmt/pkg
make install clean
echo WITH_PKGNG=yes >> /etc/make.conf
pkg2ng
The 9.x versions (from 9.1) ship an alias to install pkg easily:
pkg
echo WITH_PKGNG=yes >> /etc/make.conf
pkg2ng
pkgng is bundled by default.
pkg search <name>
pkg install <name>
pkg remove <name>
pkg autoremove
pkg update
pkg upgrade
pkg info
This prevents an installed package from being modified (upgraded or removed). It’s very useful in development environments, for instance.
pkg lock <name>
pkg unlock
This feature uses an audit database to identify vulnerable packages on the system.
pkg audit
Now that binary mirrors are available, a new step has been taken for FreeBSD. The next step is a simple and robust package signature system.
For Linux users who wanted to try FreeBSD but were put off by the compilation: you no longer have any excuse not to try FreeBSD!