I have a desktop and laptop at home, both running the same flavour of Debian Testing. How can I configure apt on the laptop so that it first tries to download the packages from the desktop before going to the Internet?
|
feedback
|
|
There are several ways. One of the easiest is to install squid. Squid is simply a web/FTP cache, but that means it will cache your Debian downloads--as well as any web sites. So it has an added bonus! One drawback of using squid (or any caching proxy server) is that your sources.list must all point to the same mirror, or the cache hits won't help. Another option is apt-proxy. I haven't used it, but my understanding is that it works much like squid, but is specifically tailored for use with apt repositories--so it may not require that you use the same mirror for all machines, and may have other apt-specific optimizations. A third option is to set up a partial mirror that you keep in sync with an upstream mirror. This probably isn't really what you want, though, as it's much more involved to configure, and uses a lot more bandwidth. And a final, poor-man's option, would be to keep /var/cache/apt/archives in sync between the two systems, possibly using rsync. You could simply run this command before doing any apt installs:
This won't cache the Packages files at all (the other methods I mentioned would), but whenever the system is about to download a package, if that package already exists in that dir, it won't do the download. So you'd get most of the benefit of a proper caching server, without the setup overhead. I generally only use this last method for one-off instances, like on a fresh install. | |||||
feedback
|
|
I think you should try out apt-cacher. If you click that link, you'll be taken to a guide/tutorial that explains, in fairly nice detail, how to do this. | |||
|
feedback
|
