Ubuntu – Using an APT proxy for downloads during installation

aptinstallationlive-cdPROXY

During system installation from a Desktop LiveCD (10.10) I checked the "Download updates during installation" option.

Before starting the install I had configured an apt proxy server.

The proxy server was configured by writing

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

to the new file /etc/apt/apt.conf.d/02proxy on the running system booted from the LiveCD.

This proxy was used correctly for my various package installs on the live system prior to launching the system installation GUI. It accesses apt-cacher-ng running in non-transparent mode on the machine apt-proxy-server.

However, the downloads taking place during the installation are not using this proxy. I verified that the file 02proxy had not been changed or removed.

Is there a way to force usage of an APT proxy during installation?

Best Answer

If you are using the Live CD, Apt is not set to use your proxy, you may be able to configure apt on the live CD to use the proxy. If you want to make this more permanent you could use a custom live CD or set your network to use the proxy by default for all connections.

personally I just use squid and cache all .deb files for about a month

from ubuntu help

Updating clients to use your proxy server apt clients need the /etc/apt/sources.list file to be reconfigured to point to the new apt-proxy server instead of the outside world. Configuration of the sources.list file looks similar to the config for normal apt repositories with the exception that the backend section has to be appended to the path:

example of changes

deb http://apt-proxy:port/backend dist component Replace mentions of specific repository URL with references to your server and the backend for it; such as:

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

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

would become

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

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

A sources.list corresponding to the apt-proxy-v2.conf above may look like this:

apt-proxy entries for standard modules

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

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

apt-proxy entries for security patches

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