man apt-proxy.conf (Formats) - configuration file for apt-proxy


apt-proxy.conf - configuration file for apt-proxy


apt-proxy.conf is the configuration file for apt-proxy. When apt-proxy starts up, it will read /etc/apt-proxy/apt-proxy.conf.

/etc/apt-proxy/apt-proxy-v2.conf will be read instead if it exists to make upgrading from v1 easier.

The configuration file is divided up into several sections, where each [resource] section defines a seperate resource. The DEFAULT section applies to all resources.

The supplied apt-proxy.conf will work out of the box, but it is best to change the backends you use to a mirror closer to you. There are some in the default file, and it may be enough just to reorder the lines in the file.


This section holds options global to the whole apt-proxy:

IP address on which apt-proxy will listen for requests. Multiple addresses have a empty space between it.
TCP port on which apt-proxy will listen for requests.
If different from off, means that Packages and other control files will not be refreshed more frequently than this number of seconds.
Maximum I/O timeout in seconds for backend transfers. Default: 30 seconds. If no response is received from a backend server in this time, apt-proxy will try the next server in the list. Y
Cache directory. Default: /var/cache/apt-proxy
If different from off, indicates the time between housekeeping attempts: delete files that have not been accessed in max_age, scan cache directories and update internal tables, ...
If different from off, indicates the maximum age of files before deletion from the cache.
If different from off, indicates the maximum number of versions of a .deb to keep. This is the number of versions per distribution, for example setting max_versions to 2 will ensure that a maximum of 6 packages would be kept: the last 2 stable versions, the last 2 testing versions and the last 2 unstable versions.
Specify on to use passive FTP, which works from behind a firewall, but may not be supported on all servers. Specify off to use active FTP instead. Default: on
Specify hostname:port to use an upstream proxy.
By default apt-proxy will add HTTP backends dynamicaly if not already defined. Specify off to restrict the available backends to those listed in the configuration file. Default: on
apt-proxy can use HTTP pipelining to fetch several files at once (up to 10), but this can generate multiple connections to each backend server. Pipelining is disabled by default until this is fixed. Set to 0 to enable experimental http pipelining. Default: 1


All other sections in the configuration file will be interpreted as resource names. The options in the section apply to this resource only.

Overrides the global timeout
backends = <protocol>://<server>/<directory> [...]
A list one or more URLs referring to servers which hold debian packages.

protocol: internet protocol to use: http, ftp or rsync

server: hostname of the backend server to contact

directory: directory name to prepend requests to for this server
Override the global setting of passive_ftp


To access a resource that's listed under a specific section name, simply append the section name (without the brackets) to the end of your deb source line in /etc/apt/sources.list

Debian main

This example shows how to give clients access to the main Debian archive:

backends =

Using this configuration, the client would use a sources.list entry like:

deb http://server:9999/debian woody main

And so the file request `/debian/woody/main/binary-i386/x11/foo_1-1.deb' would turn into a backend request of first

`' and if that failed,

`' and apt-proxy will place the downloaded package in


The website tells you to use this sources.list line:

deb sarge-backports main

You can add this to apt-proxy by creating a new section in apt-proxy.conf. In the new section, add a backends entry for the URL:

[backports] backends =

On the clients, replace the URL with one pointing to the apt-proxy resource name, in the form http://hostname:port/backend. If your apt-proxy hostname is proxy and it is running on port 9999, you would write:

deb http://proxy:9999/backports sarge-backports main

For many more examples, see the supplied /etc/apt-proxy/apt-proxy.conf.





apt-proxy(8), /usr/share/doc/apt-proxy/README, apt-proxy-import(8)


Plenty sure. Please report.


apt-proxy v2 was written by Manuel Estrada Sainz <>.