Skip to content

Files

Latest commit

author
linerlock
Nov 13, 2018
ca1165c · Nov 13, 2018

History

History
59 lines (42 loc) · 1.92 KB

USAGE.md

File metadata and controls

59 lines (42 loc) · 1.92 KB

How to configure and run go-apt-cacher

Configuration

go-apt-cacher reads a configuration file at start up. If you change the configuration file, the change will not take effect until you restart go-apt-cacher.

The default location of the file is /etc/go-apt-cacher.toml.

A sample TOML file is available here.

Directories

go-apt-cacher writes to two directories (meta_dir and cache_dir specified in the configuration file). These directories must be writable by the process owner of go-apt-cacher.

Running

As go programs cannot run as so-called daemon, running go-apt-cacher in background shall be done via process manager such as systemd or upstart.

Increase nofile resource limit to accept massive number of clients. For systemd, it is LimitNOFILE directive.

go-apt-cacher does not require root privileges. Users are strongly advised to run go-apt-cacher with a non-root account.

Options

Option Default Description
-f /etc/go-apt-cacher.toml Configuration file path.

As go-apt-cacher uses github.com/cybozu-go/well, flags provided by well is also available.

/etc/apt/sources.list

For example, if ubuntu is mapped to http://us.archive.ubuntu.com/ubuntu and security to http://security.ubuntu.com/ubuntu, you may edit /etc/apt/sources.list as follows to make it use go-apt-cacher:

deb http://<go-apt-cacher hostname>/ubuntu trusty main restricted
deb http://<go-apt-cacher hostname>/ubuntu trusty-updates main restricted
deb http://<go-apt-cacher hostname>/security trusty-security main restricted