3

Let's say I have at home 3 computers running Debian testing. They mostly have the same configuration and most of the packages installed are identical.

Every time I update/upgrade the Debian packages, they are downloaded from the Internet.

Is there a way to pre-fetch the Debian packages from the Internet and have a local, up-to-date Debian repository containing only the packages I have installed that have an available update?

So, typically, if I have vim installed and an update is released, my server will go and fetch the .deb locally and I could upgrade all my machines from the LAN. If I want to install emacs, then the local repository will not have it and it will be downloaded from the Internet.

One could call it a local apt caching system, like Squid does http caching.

Thanks!

CJlano
  • 133
  • 1
  • 4

3 Answers3

5

It seems that you are look for apt-cacher. To install it, just type:

$ sudo apt-get install apt-cacher

You can then configure apt-get to use it as proxy by creating a file /etc/apt/apt.conf.d/01proxy with content:

Acquire::http::Proxy "http://cacher_ip:3142/";

To be honest, I am using this configuration on ubuntu, but it should be similar on debian. This way all package downloads will be requested from apt-cacher on server "cacher_ip". If it exists, it will be fetched locally. Otherwise, it will be downloaded via the cacher.

Khaled
  • 36,533
  • 8
  • 72
  • 99
0

The squid proxy actually does quite a good job "out of the box" caching apt-get downloads as well as a lot more besides that. With a few tweaks it will do an even better job.

See: http://itkia.com/using-squid-to-cache-apt-updates-for-debian-and-ubuntu/

aseq
  • 4,610
  • 1
  • 24
  • 48
0

Apt-cacher-ng cannot know exactly what's available as update for each user because the client's can uninstall the packages without telling the server (obviously) or sometimes the packages are renamed or splited up into multiple packages. There are just too many factors. If you can ignore most of them and want to pre-cache every package selecting them by names (of previously download packages), have a look at https://www.unix-ag.uni-kl.de/~bloch/acng/html/howtos.html#mirroring