The objective is that my Debian servers pool can share a same cached package repository downloaded from a official Debian repository.
It is not a mirror repository, apt-cacher only save the most frequently and necessary packages downloaded. For example updates about the base system.
Download one time a package and before share it with all common distribution servers available in the farm.
shell> apt-cache show apt-cacher
Package: apt-cacher
Priority: optional
Section: net
Installed-Size: 308
Maintainer: Mark Hindley <mark@hindley.org.uk>
Architecture: all
Version: 1.6.12
…
Description: Caching proxy for Debian package and source files
Apt-cacher performs caching of .deb and source packages which have been
downloaded by local users. It is most useful for local area networks with slow
internet uplink.
.
When a package is requested, the cache checks whether it already has the
requested version, in which case it sends the package to the user immediately.
If not, it downloads the package while streaming it to the user at the same
time. A local copy is then kept for use by other users.
.
Apt-cacher has been optimized for best utilization of network bandwidth and
efficiency even on slow low-memory servers. Multiple ways of installation are
possible: as a stand-alone HTTP proxy, as a daemon executed by inetd or as a
CGI program. Client machines are configured by changing APT’s proxy
configuration or modification of access URLs in sources.list.
.
The package includes utilities to clean the cache (removing obsolete package
files), generate usage reports and import existing package files. Experimental
features include a simple package checksum verification framework, optional
IPv6 support and pre-fetching of new packages (upgrade candidates).
.
Apt-cacher can be used as a replacement for apt-proxy, with no need to modify
client’s /etc/apt/sources.list files (and even reusing its config and cached
data), or as an alternative to approx.
shell> apt-install apt-cacher
apt-cache configuration file (/etc/apt-cacher/apt-cacher.conf)
“Default directory to save downloaded packages. The first runtime apt-cacher will populate the defined directory.”
cache_dir=/master/apt-cacher
“Disable the automatic cleaning. By default apt-cacher clean repository each 24 hours”.
clean_cache=0
apt-cacher repository directory permissions
“If you use a different directory remember update the permission before work with it”
shell>chown www-data:www-data -R /master/apt-cacher
apt-cache configuration file (/etc/default/apt-cacher)
"Enable the start up daemon at operating system boot time"
AUTOSTART=1
apt-proxy configuration file (/etc/apt/apt.conf.d/01proxy)
“Define the use of apt-cacher en each server that are present in the Debian server pool . If the file directive is not present create it.”
Acquire::http::Proxy “http://hostname:3142″;
apt-cacher daily usage report
“Check the use of apt-cacher in the URL. Data is updated every 24 h by default.”
http://hostname:3142/report
“Sample 24 h report”
