---
name: "apt-proxy.conf"
section: "5"
platform: "linux"
package: "apt-proxy"
version: "1.9.36.3+nmu1"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/apt-proxy.conf"
---

# apt-proxy.conf(5)

configuration file for apt-proxy

## NAME

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

## DESCRIPTION

**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 separate 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.

## \[DEFAULT\]

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

- **address**

  IP address on which apt-proxy will listen for requests. Multiple addresses have a empty space between it.

- **port**

  TCP port on which apt-proxy will listen for requests.

- **min\_refresh\_delay**

  If different from **off**, means that Packages and other control files will not be refreshed until they are at least this age.

- **timeout**

  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\_dir**

  Cache directory.  Default: /var/cache/apt-proxy

- **cleanup\_freq**

  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, ...

- **max\_age**

  If different from **off**, indicates the maximum age of files before deletion from the cache.

- **max\_versions**

  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. NOTE: If your system clock is very inaccurate this will not work properly and should be disabled.

- **passive\_ftp**

  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

- **http\_proxy**

  Specify **\[username:password@\]hostname:port** to use an upstream proxy. Username and password are optional.

- **dynamic\_backends**

  By default apt-proxy will add HTTP backends dynamically if not already defined. Specify **off** to restrict the available backends to those listed in the configuration file.  Default: on

- **disable\_pipelining**

  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

- **bandwidth\_limit = *amount***

  When downloading from a backend server, limit the download speed to  *amount* bytes per second. Note this applies to **http** and **rsync** backends only. Default: no limit

## RESOURCES

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

- **timeout**

  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

- **passive\_ftp**

  Override the global setting of passive\_ftp

- **bandwidth\_limit**

  Set a bandwidth limit for downloads for this resource, overriding the global bandwidth\_limit

- **http\_proxy**

  Specify **\[username:password@\]hostname:port** to use an upstream proxy, overriding the global http\_proxy.

- **min\_refresh\_delay**

  Override the global min\_refresh\_delay for this backend. Set this to the interval at which this archive is usually refreshed.

## CONFIGURATION EXAMPLES

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:

```
[debian]
backends = http://ftp.us.debian.org/debian/
           http://ftp.de.debian.org/debian/
```

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

```
    `http://ftp.us.debian.org/debian/woody/main/binary-i386/x11/foo_1-1.deb'
```

and if that failed,

```
    `http://ftp.de.debian.org/debian/woody/main/binary-i386/x11/foo_1-1.deb'
```

and apt-proxy will place the downloaded package in

```
    `/var/cache/apt-proxy/debian/debian/woody/main/binary-i386/x11/foo_1-1.deb'.
```

**backports.org**

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

```
    deb http://www.backports.org/debian 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 = http://www.backports.org/debian
```

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.

## FILES

/etc/apt-proxy/apt-proxy.conf\
 /etc/apt-proxy/apt-proxy-v2.conf

## SEE ALSO

**[apt-proxy(8)](/apt-proxy/8.md),** **/usr/share/doc/apt-proxy/README,** **[apt-proxy-import(8)](/apt-proxy-import/8.md)**

## BUGS

Plenty sure.  Please report.

## AUTHOR

apt-proxy v2 was written by Manuel Estrada Sainz \<ranty@debian.org\>.
