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.


3 Answers 3


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.

  • 1
    apt-cacher-ng is a good alternative, as well. Commented Mar 20, 2012 at 15:40
  • Great answer, thanks! The apt-cacher keyword helped me to find other alternatives, such as approx and apt-cacher-NG.
    – CJlano
    Commented Mar 20, 2012 at 15:44
  • @ShaneMadden: You are right. Actually, I am using apt-cacher-ng!
    – Khaled
    Commented Mar 20, 2012 at 15:54
  • I have a strong preference for approx, mostly because the etch version of apt-cacher was kinda buggy for me.
    – Zoredache
    Commented Mar 20, 2012 at 17:07
  • etch is an old old old debian version. Things surely have changed :)
    – hayalci
    Commented Mar 21, 2012 at 13:49

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/


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .