pkg_add -r and sudo in FreeBSD
I usually install software in my FreeBSD servers using the ports collection instead of installing binary pre-compiled packages (I don't want a flame about this, I prefer to compile the software, period) but, from time to time, I use the package collection too.
Today, while playing with a 8.0-RC2 box, I noticed that pkg_add -r (to install packages remotely from the FreeBSD ftp server) doesn't work properly with sudo:
[nidhogg] ~> sudo pkg_add -r lynx Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.0-release/Latest/lynx.tbz: Syntax error, command unrecognized pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.0-release/Latest/lynx.tbz' by URL [nidhogg] ~>
It works fine as root:
nidhogg# pkg_add -r lynx Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.0-release/Latest/lynx.tbz... Done. To enable certificate handling for SSL connnections, set SSL_CERT_DIR and SSL_CERT_FILE in your environment to the proper values (depending upon which SSL library /usr/local/bin/lynx uses), as described in: /usr/local/share/doc/lynx/docs/README.sslcerts and: /usr/local/share/doc/lynx/docs/README.rootcerts. You may also need to generate keys and certificates as described in the latter document and your SSL documentation. nidhogg#
Anyone that could explain it? (Probably something related to sudo being more restrictive with the env vars settings?)