That is not the extent of the sudo settings.  You have to look at the
sudoers file to check whether the env settings are kept or not.

Try bypassing sudo entirely:

$ sudo su -
# export http_proxy=http://192.168.178.23:3128
# export ftp_proxy=http://192.168.178.23:3128
# pkg_add -ui

-Gene

On Tue, Feb 17, 2015 at 2:14 PM, Stefan Wollny <stefan.wol...@web.de> wrote:

> Am 02/17/15 um 22:54 schrieb Gene:
> > Squid can work as an FTP proxy, and I imagine in your case it probably
> > does.  Try setting it and trying the pkg_add command again.
> >
> > Additionally, you'll want to make sure that your proxy environment
> > variables are being passed through sudo.  If sudo is configured to use
> > env_reset and env_keep and it isn't retaining those variables then the
> > proxy won't be used at all.
> >
> > -Eugene
>
> Hi Eugene,
>
> thank you for your time - really appreciate it!
>
> Of course I gave your suggestion a try, even though I was shure it would
> not make a difference: I have described the situation right now at home
> - but the very same behaviour could be reported while being in a hotel
> using their WLAN.
>
> SUDO-settings:
> %wheel  ALL=(ALL) NOPASSWD: SETENV: ALL
> (this is not a server but my personal laptop to this seems to be OK)
>
> ~ $ cat .profile | grep proxy
>
> export http_proxy=http://192.168.178.23:3128
> export  ftp_proxy=http://192.168.178.23:3128
>
>
> ~ $ sudo pkg_add -ui
> quirks-2.52 signed on 2015-02-17T13:51:20Z
> g++-4.8.4p1:.libs1-gcc-4.8.3p1+.libs1-gcc-4.8.3p3+gcc-4.8.4p1->gcc-4.8.4p2:
> ok
> g++-4.8.4p1->4.8.4p1: ok
> gcj-4.8.4p1->4.8.4p1: ok
> hpijs-3.15.2->3.15.2: ok
> Error from
>
> http://ftp.hostserver.de/pub/OpenBSD/snapshots/packages/amd64/icu4c-54.1p3.tgz
> ftp: connect: No route to host
>
> Boooom! Connection lost again.
> (As I had a 'pkg_add'-run before we reached letter 'h' this time...)
>
> I think 'ftp_proxy' can be ruled out.
>
> Nevertheless it was worth trying.
>
> Thank you and have a nice day!
>
> STEFAN

Reply via email to