Setting fetch environment in pkg.conf (pkgng)

Michael Gmelin freebsd at
Sat Apr 13 19:55:24 UTC 2013


I recently converted a host from to pkgng and getting the following

Checking for packages with security vulnerabilities:
pkg: No route to host
pkg: Cannot fetch audit file!

Portaudit was configured to use a proxy
in /usr/local/etc/portaudit.conf:


I'm aware that pkg uses libfetch directly, but since most
configuration in libfetch happens through setting environment
variables, it would be great if it could be set before calls to
libfetch's fetchGet* functions instead of setting it in the
environment used (modify cron jobs etc.). Since there are different
applications for fetch in pkg I would suggest the following settings

# environment for fetching auditfile (pkg-audit(8))
audit_fetch_env = "HTTP_PROXY="

# environment for talking to the repo (pkg-update(8), pkg-upgrade(8)...)
repo_fetch_env = "SSL_CLIENT_KEY_FILE=/etc/ssl/pkgclient01.key \
                  SSL_CLIENT_CERT_FILE=/etc/ssl/pkgclient01.crt \

In case there are other uses of libfetch in the code, further settings
could be added - also for talking to multiple repositories.



PS: The example for repo_fetch_env assumes that has been

Michael Gmelin

More information about the freebsd-ports mailing list