在安装期间使用APT代理进行下载

在从Desktop LiveCD(10.10)进行系统安装期间,我选中了“安装期间下载更新”选项。

在开始安装之前,我已经配置了一个apt代理服务器。

代理服务器是通过编写配置的

Acquire::http { Proxy "http://apt-proxy-server:3142"; }; 

到从LiveCD启动的正在运行的系统上的新文件/etc/apt/apt.conf.d/02proxy

在启动系统安装GUI之前,此代理已正确用于实时系统上的各种软件包安装。 它访问在机器apt-proxy-server上以非透明模式运行的apt-cacher-ng

但是,安装期间发生的下载不使用此代理。 我确认文件02proxy没有被更改或删除。

有没有办法在安装过程中强制使用APT代理?

如果您使用的是Live CD,则Apt未设置为使用您的代理,您可以在live CD上配置apt以使用代理。 如果您想使其更加永久,您可以使用自定义Live CD或将网络设置为默认情况下为所有连接使用代理。

我个人只是使​​用squid并缓存所有.deb文件大约一个月

来自ubuntu的帮助

更新客户端以使用代理服务器apt客户端需要重新配置/etc/apt/sources.list文件以指向新的apt-proxy服务器而不是外部世界。 sources.list文件的配置看起来类似于普通apt存储库的配置,但后端部分必须附加到路径:

变化的例子

deb http:// apt-proxy:port / backend dist component用对服务器及其后端的引用替换特定存储库URL的提及; 如:

 deb http://archive.ubuntu.com/ubuntu dapper main restricted deb http://security.ubuntu.com/ubuntu dapper-security main restricted universe 

会成为

 deb http://server:9999/ubuntu dapper main restricted deb http://server:9999/ubuntu-security dapper-security main restricted universe 

与上面的apt-proxy-v2.conf相对应的sources.list可能如下所示:

标准模块的apt-proxy条目

 deb http://localhost:9999/ubuntu dapper main restricted universe multiverse deb-src http://localhost:9999/ubuntu dapper main restricted universe multiverse 

安全补丁的apt-proxy条目

 deb http://localhost:9999/ubuntu-security dapper-security main restricted universe multiverse deb-src http://localhost:9999/ubuntu-security dapper-security main restricted universe multiverse