在安装过程中使用 APT 代理进行下载

int*_*ted 9 live-cd installation apt proxy

在从桌面 LiveCD (10.10) 安装系统期间,我选中了“安装过程中下载更新”选项。

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

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

Acquire::http { Proxy "http://apt-proxy-server:3142"; };
Run Code Online (Sandbox Code Playgroud)

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

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

但是,安装期间进行的下载并未使用此代理。我确认该文件02proxy未被更改或删除。

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

jso*_*ski 4

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

就我个人而言,我只使用鱿鱼并将所有 .deb 文件缓存大约一个月

来自 ubuntu 帮助

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

变化的例子

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

deb http://archive.ubuntu.com/ubuntu dapper main restricted

deb http://security.ubuntu.com/ubuntu dapper-security main restricted universe
Run Code Online (Sandbox Code Playgroud)

会成为

deb http://server:9999/ubuntu dapper main restricted

deb http://server:9999/ubuntu-security dapper-security main restricted universe
Run Code Online (Sandbox Code Playgroud)

与上面的 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
Run Code Online (Sandbox Code Playgroud)

安全补丁的 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
Run Code Online (Sandbox Code Playgroud)