[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can I unset one of apt.conf settings by -o option of apt-get?



On 25/04/11 17:56, Kai NODA wrote:
Hi, all

Suppose that

$ cat /etc/apt/apt.conf
Acquire {
http::Proxy "http://my.proxy.example:80/";;
[snip]
}

then I had a problem:

$ apt-get source util-linux -o Acquire::http::Proxy=''
E: Option Acquire::http::Proxy=: Configuration item specification must
have an =<val>.
$ apt-get -o Acquire::http::Proxy='' source util-linux
E: Invalid operation util-linux
$ apt-get source -o Acquire::http::Proxy='' util-linux
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Must specify at least one package to fetch source for

That is, I (sometimes) want to unset Acquire::http::Proxy option
temporarily as if it didn't exist in apt.conf.
`man 8 apt-get` tells me that apt-get recognizes -c option and
APT_CONFIG env var, but they are not what I want.
I want to keep other settings untouched rather than unset all of them
(by using an empty apt.conf instead.)

Is this feasible on the current implementation? (apt-get or aptitude)
Thanks in advance.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux testing (wheezy)
Release:        testing
Codename:       wheezy
$ uname -a
Linux zbox 2.6.38-2-amd64 #1 SMP Thu Apr 7 04:28:07 UTC 2011 x86_64 GNU/Linux
$ aptitude show apt
[snip]
Version: 0.8.13.1
[snip]

This is just a guess, try putting double quotes around the option:

apt-get -o "Acquire::http::Proxy=''" source util-linux

I haven't got a system I can test this out on properly, but a quick test with 'install' instead of 'source' gave the same error as you got until I put in the quotes.

--
Dom


Reply to: