We've got a Squid web cache set up that is used for caching package downloads, so that all the machines here don't have to independently redownload everything. The installer prompts for a mirror and proxy. As long as every machine uses the exact same mirror (here, http.us.debian.org) and the proxy then it works.That's somewhat annoying, as it involves going to 'enter information manually' and typing it in each time (as the installer would do ftp.us.debian.org, which Squid doesn't realize is identical).The installer defaults to just mirror, is there a way to make that work? So I can be lazy and just hit enter a bunch?
Can I easily make a host mirror that caches downloaded Debian packages?
debian;apache httpd;cache;squid
For having a local deb cache to server my Debian server farm, I actually prefer to use apt-cacher-ng (caching proxy server for software repositories) It is a proxy specially APT/deb aware, quite customisable and can cache your deb files for quite a while (configurable).You install it with:apt-get install apt-cacher-ngAnd by default it caches repositories/debs into /home/apt-cacher-ng. Under this directory, it creates a directory per repository used in your Debian servers, then distros used, much similar to mirror structures. As an added bonus, is also much easier to fetch manually a deb from cache from here, than from a Squid server.To use it in all your servers, add to the directory /etc/apt/apt.conf.d a file 02proxy with the contents:Acquire::http { Proxy http://your_proxy_APT_server:3142; };After you add that file, the Debian package manager will proxy all the configured repositories via the configured http APT proxy.It also got an interesting statics page for consulting its activity.You might also need to open 3142/TCP in your firewalls to allow the servers to talk with your new proxy APT server.The advantage of such setup is that besides downloading only one deb copy for a bucketload of servers, and saving bandwidth and the public repositories usage is that allows you to update internal servers that do not need to have Internet access (example: DHCP servers).As documented in Appendix B of the Official Install Guide, you can have your DHCP server give out a preseed file, by adding something like this to it's config:if substring (option vendor-class-identifier, 0, 3) = d-i {    filename http://host/preseed.cfg;}Then using these preseed options, you can configure the mirror and proxy automatically:d-i mirror/protocol string httpd-i mirror/country string manuald-i mirror/http/hostname string http.us.debian.orgd-i mirror/http/directory string /debiand-i mirror/http/proxy string http://your_proxy_APT_server:3128/See also: How to set up Apt caching server on Ubuntu or Debian