How to override pkgng's proxy configuration settings

Gian Piero Carrubba gpiero at rm-rf.it
Fri Apr 2 08:04:01 UTC 2021


* [Wed, Mar 17, 2021 at 11:22:43AM +0100] Gian Piero Carrubba:
>As soon as I modify pkg.conf for including the lines
>
>  pkg_env: {
>    http_proxy: "http://myproxy:9999"
>  }
>
>I cannot override the setting anymore.
>
># pkg -o http_proxy=myotherproxy:8008 update
># pkg -o http_proxy= update #this is the case I'm mostly interested on

For reference, the solution is:

# pkg -o PKG_ENV=envvar1=value1,envvar2=value2,... command

So, in my case:

# pkg -o PKG_ENV=http_proxy= update

While I've tried it before, I failed to have it work because, when used 
in combination with the '-o' option, PKG_ENV *must* be spelled 
uppercase.

In order to set an environment variable to the null value, you have to 
put it at the end:

# pkg -o PKG_ENV=empty=,valued=1 config pkg_env
empty: ,valued=1
valued: 1

It seems there's no way to null more than one variable at once (but I 
could have misread the source).


More information about the freebsd-questions mailing list