APt proxy configuration

Dag Wieers dag at wieers.com
Fri Jun 2 08:33:05 PDT 2006


Hi,

I'm having problems configuring apt to use a proxy. In fact here's the 
executive summary :)

I have a local repository on one of my systems with all my updated RPMs. 
All systems are told to use _that_ internal server for updates. But some 
of the servers have internet access and therefor have the http_proxy 
variable set by default.

Now the problem is, how do I tell apt to _not_ use the proxy when getting 
packages from localhost or another hostname that's internal. Currently I 
have to start apt-get like:

	http_proxy="" apt-get update

But that's annoying and only works if all the repositories are internal. 
But in some cases I use mixed internal and internet repositories.

I tried something like:

	Acquire {
	        http {
			Proxy::apt.sw.be "http://proxy:8080";
	                Proxy::localhost "DIRECT";
			Proxy::yam "DIRECT";
	                Timeout "120";
	                Pipeline-Depth "5";
	
	                No-Cache "false";
	                Max-Age "86400";     // 1 Day age on index files
	                No-Store "false";    // Prevent the cache from storing archives
	        };
	};

in /etc/apt/apt.conf.d/proxy.conf

But I'm not sure it is being used. Strangely it then seems to parse HTML 
content it gets from the proxy instead.

	[root at system root]# apt-get update
	Get:1 http://localhost rhel3as-i386/RPMS.os repomd.xml [630B]
	0% [1 repomd.xml 0/630B 
	0%]/var/state/apt/lists/localhost_yam_rhel3as-i386_RPMS.os_repodata_repomd.xml:6: 
	parser error : Opening and ending tag mismatch: meta line 5 and head
	</head>
	       ^
	/var/state/apt/lists/localhost_yam_rhel3as-i386_RPMS.os_repodata_repomd.xml:9: 
	parser error : AttValue: " or ' expected
	<img src=http://www.company.com/wps/themes/html/Company/top_logo.gif>
	         ^
	/var/state/apt/lists/localhost_yam_rhel3as-i386_RPMS.os_repodata_repomd.xml:9: 
	parser error : attributes construct error
	<img src=http://www.company.com/wps/themes/html/Company/top_logo.gif>
...

Anyone has an idea how to fix this ?

Kind regards,
--   dag wieers,  dag at wieers.com,  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]



More information about the Apt-Rpm mailing list