Errors with pkg_add

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Thu Jun 5 14:51:50 UTC 2008


Phusion <phusion2k at gmail.com> writes:

> I am running FreeBSD 7.0-STABLE i386 and am having problems with
> pkg_add. I can install packages as the root user without problems.
>
> - pkg_add -r packages, works when running as root
> - pkg_add -r packages, errors out when using sudo
>
> % sudo pkg_add -r openssl
> Error: FTP Unable to get
> ftp://ftp4.us.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/openssl.tbz:
> Syntax error, command unrecognized
> pkg_add: unable to fetch
> 'ftp://ftp4.us.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/openssl.tbz'
> by URL
>
> % cat /usr/local/etc/sudoers
> Defaults        env_keep += "PKG_PATH PKG_DBDIR PKG_TMPDIR TMPDIR
> PACKAGEROOT PACKAGESITE PKGDIR"
> Defaults        env_keep += "PORTSDIR PORTS_INDEX PORTS_DBDIR PACKAGES
> PKGTOOLS_CONF"
> root    ALL=(ALL) ALL
> %wheel  ALL=(ALL) NOPASSWD: ALL
>
> This user is a member of the wheel group so no password is required.
> Both this user and root user are using the csh with the following in
> .cshrc.
>
> setenv  PACKAGESITE
> ftp://ftp4.us.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/
>
> Let me know if you have any ideas. Thanks.

sudo may not be setting up the environment correctly.  I seem to
recall it recently changed defaults to wiping out more of the caller's
environment than had previously been the case.

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
		http://be-well.ilk.org/~lowell/


More information about the freebsd-questions mailing list