Installing apt-cacher server for two ubuntu versions

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


Using apt-cacher-ng could be an alternative. You can find the manual here.