Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
15
rated 0 times [  15] [ 0]  / answers: 1 / hits: 15125  / 2 Years ago, sat, october 29, 2022, 6:14:43

Is there a way to use acquire::http::proxy for some repositories?



I'm in a network that has a proxy server. So everybody has to update /etc/apt/apt.conf adding the lines like



Acquire::http::Proxy "http://yourproxyaddress:proxyport";
Acquire::https::Proxy "http://yourproxyaddress:proxyport";
Acquire::ftp::Proxy "http://yourproxyaddress:proxyport";
Acquire::socks::Proxy "http://yourproxyaddress:proxyport";


Everything working ok with that.



But now we have a LOT of ubuntu machines and I want to do a local ubuntu mirror.



So we should erase those proxy lines.... except for external repositories.



So, how do I configure something like that?



In RH based distros you can have a global proxy setting for yum and then use individual proxy settings for each repository. But didn't found something similar un Ubuntu.


More From » networking

 Answers
7

Finally I got it working as I wanted.



For every local mirror you have to add a line like this:



Acquire::http::proxy::local.mirror.address "DIRECT";


So, in /etc/apt/apt.conf I got something like:



Acquire::http::Proxy "http://yourproxyaddress:proxyport";
Acquire::http::proxy::local.mirror.address "DIRECT";
Acquire::https::Proxy "http://yourproxyaddress:proxyport";
Acquire::ftp::Proxy "http://yourproxyaddress:proxyport";
Acquire::socks::Proxy "http://yourproxyaddress:proxyport";


That way I can use our web proxy for outside/external repositories and be able to use our local repository mirror without a web proxy.


[#28788] Sunday, October 30, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
iedncommon

Total Points: 200
Total Questions: 95
Total Answers: 132

Location: Tonga
Member since Mon, Aug 2, 2021
3 Years ago
iedncommon questions
Sat, Jun 4, 22, 18:20, 2 Years ago
Mon, Apr 4, 22, 08:10, 2 Years ago
Tue, Jul 6, 21, 15:11, 3 Years ago
;