13

I am a student at Case Western Reserve University, and the bandwidth from the Ubuntu servers to my location is often horrendously bad (on the order of a few hundred bytes per second). Myself and a few friends would like to be able to download the packages once, and have them cached for the rest of our Ubuntu installations on campus. To do that, we would either need to setup our own APT repositories, or setup some form of caching (squid?) server at which we could point our systems.

Is setting up such a mirror a difficult process? How would one accomplish it?

5
  • possible duplicate of Best way to cache apt downloads on a LAN?
    – 8128
    Oct 27, 2010 at 19:30
  • Not even 1k/s? I'd recommend that you complain to your system administrator. Even Starbucks' free wifi can reach 150k/s.
    – Gödel
    Oct 27, 2010 at 21:10
  • 1
    @Gödel: The actual connection is much faster -- I get downloads of 1MB/s pretty much everwhere except aptitude related stuff. The mirror in this are just seems to be extremely slow. Oct 28, 2010 at 2:57
  • 1
    I'm also at CWRU and have seen less than stellar speeds to the default mirror. Have you tried using a mirror that is on Internet2 such as mirror.anl.gov? I can often get speeds greater than 1MB/s to such mirrors.
    – Eric Perko
    Mar 4, 2011 at 3:51
  • @Eric: Ah -- switching the mirror does seem to fix the problem. Perhaps the "Select best mirror" bit cares more about latency than bandwidth. Thanks! Apr 5, 2011 at 23:16

2 Answers 2

12

You might want to use apt-proxy instead of a full mirror, since it will then take considerably less space and time to get set up:

https://help.ubuntu.com/community/AptProxy

You would then need to update the repository lists for anyone wanting to use your proxy.

4

There are several ways to mirror a repository or cache package downloads. What is the best solution depends on how many people are going to use it and what infrastructure is already available.

For example, many universities already have local software mirrors, and in that case the easiest solution is probably to add Ubuntu to that mirror. ;)

And if your university already has a proxy server, it might be possible to use that (maybe with some custom settings for the repositories?).

When you want to mirror the whole or some part of the official repositories (and/or other repositories), you can use something like apt-mirror, debmirror, debpartial-mirror, mirrorkit or ubumirror. Mirroring the whole repositories might pull in a lot of packages that nobody ever uses, so if bandwidth is really an issue (even at night) it might be useful to mirror only the popular packages...

When you want to cache only the used packages, there are apt-cacher, apt-cacher-ng or apt-p2p, or a proxy like Squid.

One advantage of having a local mirror (when compared to a cache) is that installation/upgrades will always be fast (for the packages that are available on the mirror), while when using a cache the first person who needs a package will have to wait until it's downloaded. You can also configure the mirror to update at night, so that downloading packages happens when (almost) nobody else is using the internet uplink.

OTOH the advantage of using a cache is that you will only download exactly what packages are needed, and never more than that.

You must log in to answer this question.

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