apt-cacher
When running multiple machine with the same distribution, it is interesting to set up a repository cache on your network so that once a package is downloaded from an official repository, all other machines will download it from your local area network.
Having different machines running the same linux distribution, it becomes interesting to set up a repository cache somewhere on your network. This way, you won't download common packages more than 1 time from official repositories.
Here is the situation, we have one machine called repository-cache, this machine is going to act as the repository cache, basically, any other machines in your network is going to use it as a repository.
1. How To Set up a repository cache with apt-cacher
How To Set up a repository cache with apt-cacher
2. Conclusion
apt-cacher is an easy and efficient package which will save you both time and bandwidth when using multiple machines with the same distribution like it could happen in a home network or in at a company.
apt-mirror
It is a perl-based utility for downloading and mirroring the entire contents of a public repository. This may likely include packages that you don't use and will not use, but anything stored in a public repository will also be stored in your mirror.
1. How To Set up a repository cache with apt-cacher
To configure apt-mirror you will need the following:
apt-mirror package `sudo apt-get install apt-mirror`
apache2 package `sudo apt-get install apache2`
**roughly 15G of storage per release, per architecture**
How to Set up a repository with apt-mirror
2. Conclusion
I find this difficult but very effective in saving bandwidth but on the other side the results is a high consumption of disk space.
apt-cacher-ng
is a caching proxy for downloading packages from Debian-style
software repositories (or possibly from other types).
The main principle is that a central machine hosts the proxy for a local
network, and clients configure their APT setup to download through it.
Apt-Cacher NG keeps a copy of all useful data that passes through it, and when
a similar request is made, the cached copy of the data is delivered without
being re-downloaded.
Apt-Cacher NG has been designed from scratch as a replacement for
apt-cacher, but with a focus on maximizing throughput with low system
resource requirements. It can also be used as replacement for apt-proxy and
approx with no need to modify clients' sources.list files.
2. Conclusion
is a caching proxy specialized for package files from GNU/Linux distributors, primarily for Debian and Debian based distributions (like Ubuntu). This means that if you have many Debian/Ubuntu machines on your network, you just have to download the deb packages (new software, updates, distro upgrades, etc) from the internet once and the rest of the Debian/Ubuntu machines get them from Apt-Cacher NG cache, saving time and internet bandwidth.
Next time any of your machines needs a deb package, it will ask Apt-Cacher NG for it. If this package was asked previously by any of the other machines, Apt-Cacher will have a copy and will deliver it. Otherwise, it will fetch it from the internet repositories, keep a local copy and deliver it.
Best way to cache apt downloads on a LAN? see Piskvor's answer
Let do it some markeying in Full Circle Issue #54 there is an interesting article about Part 2, Apt-Cache NG
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.
Best Answer
Ok, finally I've found a solution in this post.
Adding
in the proxy configuration /etc/apt/apt.conf.d/01proxy.