Apt-Zeroconf
Please note: Version 0.4.1 was finally released after an unfortunately long development pause and fixes a lot of issues and bugs. Please don't hesitate to file bugs if you encounter issues while using apt-zeroconf. We will try to keep up the development pace.
Overview
This is the page of apt-zeroconf, the distributed apt-cacher for local networks implemented in Python. It's called apt-zeroconf since we use avahi for automatically finding other apt-zeroconf instances on the LAN, similar to Apple's Rendezvous/Bonjour/Zeroconf technology.
Concept
When running more than one Debian box in a LAN with slow internet access the most often used solution to prevent downloading the same Debian package twice is running apt-cacher or the like on one single machine, a centralized server.
The problem with this solution is, that every machine in the network needs to be configured for this proxy. If it is down, no one can update. If you go to another network, you must tweak your sources.list or apt.conf in order to upgrade, which is quite common nowadays with notebooks and wifi technology.
We would therefore be interested in an automatic and peer-to-peer solution. When there is no apt caching daemon in the LAN, we want to fetch the packages directly from the internet. But if there is one or even more available, apt should automatically use it, without any configuration from the user. This is by the way the reason we called it apt-zeroconf in the first place.
The next question is: Who runs an apt caching daemon? In our first implementation, everyone running apt-zeroconf also shares his apt package cache in /var/cache/apt/archives to everyone in the network.
Now, one might think this could potentially pose a security threat as everyone can offer and distribute debs without any authentication whatsoever. This is not the case as we are not yet caching the package lists or pdiffs, which are PGP-signed and contain MD5, SHA1 and SHA256 checksums of the packages. But due to the trusted PGP signatures, caching package lists shouldn't be an issue.
Technical Details
Apt-zeroconf consists of two parts: a http server and the avahi-related stuff. Avahi is used to let everyone else in the network know that you have an apt-zeroconf caching service installed and running. The httpd does act as http server if used in fake-mirror-mode, but also as http proxy if you're using it as such with apt. It uses port 1618 by default.
In every mode, apt-zeroconf is provided with a fallback mirror by apt, so if there are no apt-zeroconf instances on the LAN offering your deb, your regular Debian mirror will be used to provide apt with the necessary files. See Configuration for details.
Configuration
Configuration is done automatically by installing apt-zeroconf. You can disable apt-zeroconf through debconf (dpkg-reconfigure apt-zeroconf) and configure it to your liking. The default configuration is Proxy Mode.
Please note that you just need to carry out the following steps if you didn't activate apt-zeroconf through debconf. These modes are just listed for advanced usage.
- Proxy Mode
Add the following line to your /etc/apt/apt.conf.d/10apt-zeroconf (this may be done by debconf already):
Acquire { http { Proxy "http://127.0.0.1:1618"; } }
This way every mirror listed in your sources.list will be cached.
Where to get it
Grab it while it's hot from:
- tgz: http://phidev.info/azc/apt-zeroconf_0.4.1.tar.gz
- deb: http://phidev.info/azc/apt-zeroconf_0.4.1_all.deb
- dsc: http://phidev.info/azc/apt-zeroconf_0.4.1.dsc
Release Notes:
- 0.4.1
- exchanged debhelper.mk and python-distutils.mk in debian/rules to make pycentral fully work and modified debian/control accordingly (solves problems with Ubuntu gutsy where python2.5 is current), fixes #29
- 0.4
- configuration system
- more robust initscript
- implemented HTTP POST (for compatibility with apt-listbugs)
- IPv6 support
- 0.3~rc4
- install init-script with priority 25
- support old pyinotify api for etch
- 0.3~rc3
- fixed import error when started from initscript
- 0.3~rc2
- new initscript (now in /etc/init.d)
- fixed permissions of logfile and runfile
- handle avahi restarts properly
- 0.3~rc1
- code refactoring, many fixes all along the place
- fix problems with epochs
- compatible with new pyinotify api
Or just add our repository into your sources.list while it's not yet in Debian:
deb http://phidev.info/azc ./ deb-src http://phidev.info/azc ./
Development Version
You can get our latest development version of apt-zeroconf through svn:
svn co svn://phidev.info/u03a6/projects/apt-zeroconf/trunk apt-zeroconf
Known Issues
- #44
- KeyError: 'pkglist'
- #64
- Apt-Zeroconf not working on Ubuntu Hardy (Release)
- #6
- Get Apt-Zeroconf into Debian
- #12
- Support for in-progress downloads
- #13
- Improve new package/file notification protocol
- #14
- Offer caching repositories' package list
- #33
- Bind to specific interface
- #48
- AZC doesn't update on update request
- #57
- AZC download speed is limited by CPU on hardy
- #63
- Improve robustness of handling broken apt-zeroconf hosts (and blank package lists)
- #9
- Statistics
- #28
- greedy option
- #35
- FTP proxy support
- #34
- Support for apt-proxy
How to help
Support
- Mailing List: azc-user@…, subscribe by sending a mail with the subject "subscribe" to azc-user-request@…
- Jabber MUC on conference.phidev.org in the room phidev
