What exactly is the difference between apt-cacher and apt-cacher-ng? I can't seem to find anywhere comparing the two. I've found tutorials and manuals on both of them, and they seem to be the same from the set-up point of view.

Is one better or more reliable than the other? Does one offer services that the other does not? What are the pros and cons of each?


From the documentation (available in /usr/share/doc/apt-cacher-ng/apt-cacher-ng.pdf, if you have installed it):

The program reuses many ideas behind the other famous proxy, its predecessor apt-cacher 1.x (which has been written in Perl). In contrast to apt-cacher, different aspects have been declared as primary targets during the development of apt-cacher-ng:

  • lightweight implementation - allow use on systems with low memory and processing resources
  • internal (native) threading - avoiding process fork'ing wherever possible, avoiding kludges for pseudo-thread synchronization, avoiding relying on special file system features for internal operations where possible
  • real (effective) support of HTTP pipelining, using an internal client with native stream control (having the nice side effect: reduction of resource overhead and minimization of possible points of failure)
  • avoiding featuritis where they cause too much bloat and the functionality can be provided by native OS features
  • reliable but efficient content merging in the local package pool, avoiding delivering of wrong data.

As with apt-cacher, explicit tracking of dynamically changed and unchanged files is established, and the use in non-Debian environment is supported.

Long story: Not all goals have been achieved. The initial plan of using background databases to merge any download from any arbitrary location has been dropped because of complexity and performance considerations, reliable heuristics could not be found either. Instead, a semi- automated solution has been created which used machine-parsable files with mirror information, like the one available for Debian mirrors in Debian's CVS repository.

  • You quote: "the use in non-Debian environment is supported" .. this means that I can serve Ubuntu repos from a different Linux distro? Just to confirm, thanks.
    – becko
    Sep 16 '16 at 12:26
  • @becko I have never tried it but a) it doesn't seem to rely on any Debian-ish behaviour of the server, and b) it can work as a proxy for other distros. You should be able to use it on other distros.
    – muru
    Sep 16 '16 at 13:01
  • @becko you can use apt-cacher-ng as a cacher for Fedora or even Centos/RHEL based distributions with little to no tweaking(if i remember well, last time i've implemented it on another job, it was just a matter of allowing the cache of the xml files that contain the repo data for those distros).
    – user494660
    Jan 26 '18 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.