少しハマったので、メモがてら。
社内のdebリポジトリとかがある環境(例えば、http://192.168.1.1/aptとかとする)で、例えば/etc/apt/sources.listに以下のような記述をしたとする。
/etc/apt/sources.list
deb http://192.168.1.1/apt/ ./ deb http://jp.archive.ubuntu.com/ubuntu/ xenial main universe multiverse deb http://jp.archive.ubuntu.com/ubuntu/ xenial-security main universe multiverse deb http://jp.archive.ubuntu.com/ubuntu/ xenial-updates main universe multiverse
この状態で外のjp.arhive.ubuntu.comにアクセスするために、下記のようにProxyを設定すると、困ったことに192.168.1.1との通信でもproxyを使おうとしてしまう。まぁ、当たり前なんだけど。
/etc/apt/apt.conf
Acquire::http::proxy "http://myproxy.local";
そんな時は"DIRECT"指定ができるらしく、Proxy使いたくないリポジトリはDIRECTとして書いてあげれば良いらしい。
/etc/apt/apt.conf
Acquire::http::proxy::192.168.1.1 "DIRECT"; Acquire::http::proxy "http://myproxy.local";
べんりー
参考
networking - acquire::http::proxy for only specified repositories - Ask Ubuntu