Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have several Linux virtual machines running on my home PC. One of the quirks of Linux is that every time you run a package manager, it wants to "refresh" the configured software repositories - which basically means it wants to download a file from the Internet. If I revert to an earlier snapshot of the VM, then next time I run the package manager it will re-download the exact same data again [since it no longer exists in the VM].

It seems a shame to waste bandwidth endlessly downloading the same data over and over again, so I was wondering if there's some way I can set up some kind of HTTP proxy server that caches downloaded files. I have no idea how you would do such a thing though. In particular, it needs to be set up so that the VMs don't need to "know" that the cache is there; it needs to be transparent. But I don't know how to do that.

Any suggestions on what software I'd need to use? It would be nice if I could run it under the Windows host OS, but running a small VM with a Linux guest is also possible...

share|improve this question

This slideshow covers several solutions for a package-caching proxy for debian-based linux distributions:


  • Runs as a proxy: You tell it what mirrors to use, and then configure the clients to use it as the sole mirror.

    Installing on the package host: sudo apt-get install apport

  • Configure Approx to use your favorite backend mirrors in /etc/approx/approx.conf:

  • Configure client to use the Approx server:

    deb http://localcache:9999/debian stable main contrib
    deb http://localcache:9999/security stable main


  • Similar to Approx

    Install with sudo apt-get install apt-proxy

  • Configure favorite mirrors in /etc/apt-proxy/apt-proxy-v2.conf:

    backends =
  • Configure clients like with Approx:

    deb http://localcache:9999/debian stable main contrib
    deb http://localcache:9999/security stable main

They're designed to be run on linux, but you might be able to port them over to Windows with minimal trouble. I'd like to hope that Python is platform independent, but I've found that programmers often make assumptions.

share|improve this answer
The "configure the client" bit was the part I was hoping to avoid. Also, I'm using OpenSUSE, which is RPM-based, not Deb. Which is why I was looking at general web caching, rather than repo-specific caching... – MathematicalOrchid Nov 3 '12 at 9:49
@MathematicalOrchid Squid is one of the usual go-to transparent HTTP proxies, but it's not optimized for large files, and a generic caching algorithm will be extremely inefficient for rpms or debs. You should add into your question that you're looking specifically for a way to cache RPM packages. – Darth Android Nov 4 '12 at 16:00

You must log in to answer this question.

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