I have made a local apt repository, but my IT-department caches LAN traffic on the proxy server. Is there a way I could work around this to disable the proxy settings for this local apt repository? in apt.conf or simular?
3 Answers
Just declare in a /etc/apt/apt.conf.d/99proxy
file something like this :
Acquire::http::Proxy {
your.local.first.repository DIRECT;
your.second.first.repository DIRECT;
};
DIRECT
tells apt to use a direct connection to connect to the repository.
This is just @Cédric Julien's answer with (thanks and) the additional syntax for defaulting to an external proxy:
Acquire::http::Proxy "http://proxy:8080";
Acquire::http::Proxy {
in-house.debian.example.com DIRECT;
no-protocol-colon-or-slashes.example.com DIRECT;
};
How again a 11 year old post, nevertheless i found it and one of the features of my code at
https://github.com/hastmu/apt-proxy-detect
is actually to skip non working proxies for some repositories, e.g. local ones.
Enjoy.
snipped of the detect process for local repos (blocked ones)
[ INFO][ 1]: ===--- apt-proxy-detect ---===
[ TEST-URL][ 16]: URL: http://local-repo.fritz.box/local-repo/dists/trunk/InRelease
[ HASH][ 24]: HASH: 2bfbb1335aaf9d333a5c9498226eb208 of (http://local-repo.fritz.box)
[ CACHE][ 29]: using stored under: /var/lib/apt/lists/auxfiles/.apt-proxy-detect._apt
[ CHECK][ 31]: once working proxy: http://192.168.0.27:8000 for http://local-repo.fritz.box/local-repo/dists/trunk/InRelease
# once working proxy failed
[ CHECK-PROXY][ 41]: Proxy (http://192.168.0.27:8000) failed with testurl (http://local-repo.fritz.box/local-repo/dists/trunk/InRelease)
# search again
[ AVAHI][ 46]: get cache entries for _apt_proxy._tcp
[ CHECK][ 91]: Checking found proxy (http://192.168.0.27:8000) with testurl (http://local-repo.fritz.box/local-repo/dists/trunk/InRelease)
[ CHECK-PROXY][ 101]: Proxy (http://192.168.0.27:8000) failed with testurl (http://local-repo.fritz.box/local-repo/dists/trunk/InRelease)
Service[ER][Squid deb proxy on squid-deb-proxy]@http://192.168.0.27:8000
[ CHECK][ 124]: Checking found proxy (http://192.168.0.27:3142) with testurl (http://local-repo.fritz.box/local-repo/dists/trunk/InRelease)
[ CHECK-PROXY][ 134]: Proxy (http://192.168.0.27:3142) failed with testurl (http://local-repo.fritz.box/local-repo/dists/trunk/InRelease)
Service[ER][apt-cacher-ng proxy on squid-deb-proxy]@http://192.168.0.27:3142
# none found (as local repos are not allowed on the proxies)
[ PROXY][ 149]: return ::
[ CACHE][ 152]: Store (NONE) in cache file (/var/lib/apt/lists/auxfiles/.apt-proxy-detect._apt)
[ CACHE][ 154]: Update cachefile.
[ INFO][ 2]: ===--- apt-proxy-detect ---===