From owner-freebsd-questions@freebsd.org Fri Apr 2 08:04:01 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B6BE5C772D for ; Fri, 2 Apr 2021 08:04:01 +0000 (UTC) (envelope-from gpiero@rm-rf.it) Received: from serafino.rm-rf.it (serafino.rm-rf.it [192.165.67.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FBXcw3hKgz4Wjh for ; Fri, 2 Apr 2021 08:04:00 +0000 (UTC) (envelope-from gpiero@rm-rf.it) Received: from valentina.fdc.rm-rf.it (valentina.fdc.rm-rf.it [192.168.192.1]) by serafino.fdc.rm-rf.it (OpenSMTPD) with ESMTP id 6cb8c470 for ; Fri, 2 Apr 2021 10:03:50 +0200 (CEST) Received: from robinhood.fdc.rm-rf.it (robinhood.fdc.rm-rf.it [192.168.192.50]) by valentina.fdc.rm-rf.it (Postfix) with ESMTP id 66802200AB for ; Fri, 2 Apr 2021 10:03:49 +0200 (CEST) Received: by robinhood.fdc.rm-rf.it (Postfix, from userid 1000) id AA7D2601F2B; Fri, 2 Apr 2021 10:03:48 +0200 (CEST) Date: Fri, 2 Apr 2021 10:03:48 +0200 From: Gian Piero Carrubba To: freebsd-questions@freebsd.org Subject: Re: How to override pkgng's proxy configuration settings Message-ID: <20210402080348.zhojt2ywohx7d74v@robinhood.fdc.rm-rf.it> References: <20210317102243.2a2vb5hftkebqj54@robinhood.fdc.rm-rf.it> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: <20210317102243.2a2vb5hftkebqj54@robinhood.fdc.rm-rf.it> X-Rspamd-Queue-Id: 4FBXcw3hKgz4Wjh X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of gpiero@rm-rf.it designates 192.165.67.94 as permitted sender) smtp.mailfrom=gpiero@rm-rf.it X-Spamd-Result: default: False [-3.30 / 15.00]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[192.165.67.94:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:192.165.67.94]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[192.165.67.94:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[rm-rf.it]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:34971, ipnet:192.165.67.0/24, country:IT]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2021 08:04:01 -0000 * [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).