What I'm not talking about

This is not the way to set up a real Debian mirror. That is covered here. I repeat, the theory covered herein will not get you a real Debian mirror.

So what exactly are we setting up?

We're going to actually use the Debian cache that you already have. Basically, if you run Debian on multiple machines on your in-house network and you only want to pull any given upgrade from the outside world once (as opposed to once for each machine), this site may help you.

The idea here stemmed from a time a couple years ago when I lived in an apartment with a friend of mine. Our only connection to the outside world was the amazingly slow dialup pool offered by SIUC. However, we were smart (stupid?) enough to set up a gateway machine that lived in the closet so we could share the connection. (Yes, we actually set up a 4 machine, bridged wired/wireless network all trickling down to a single 28.8 connection.)

The easy way

The easiest way to accomplish something along these lines is to keep the package database on your gateway machine up to date and then feed the rest of your network off of it.

I'm going to assume that you already know how to keep your package database up to date otherwise you wouldn't even be attempting to use your cache. To make your cache usable by the other machines on your network:

Setting up the client side

All you have to do on the client side is add your gateway cache to your /etc/apt/sources.list. Mine looks like the following: (tranq.wolfteck.com is the gateway whose cache I use)

deb ssh://tranq.wolfteck.com: /var/cache/apt/archives/ deb http://security.debian.org/ sarge/updates main contrib non-free deb http://ftp.us.debian.org/debian/ sarge main contrib non-free # deb ftp://ftp.nerim.net/debian-marillat/ testing main

That's it. In general it should pull from the gateway cache. In the event that the gateway is out of date or doesn't have a package, the normal debian mirrors will be used instead.

Some other ways of doing things

If you're looking for a more robust solution, consider running an apt proxy. This type of setup will cache packages that come through it as they are downloaded in the normal way by anything on the network. This is beyond the scope of the quick and easy solutions that I like to stick to here, but this is an excellent resource.

Last updated: Sunday, 20-Sep-2009 16:55:49 CDT

Contact me at randall dot will at gmail dot com

Hobbies

Vintage Motorcycles

Networking

Facebook
LinkedIn

Presence

Ubuntu
Discount ASP.NET
CPAN
p2p Wrox
Roundcube
Freshmeat
Blogger
uShip
Psychology Software Tools
Virtual Corvair Club
Chopper Charles
Live Journal

Thoughts

Borrowed Philosophy
Historical Histrionics
Current Histrionics

Old Projects

Motorola V400 / Linux
HP ZE4200 / Linux
VPR Matrix 220a5 / Linux
FreeRadius Accounting / Linux
LDAP / FreeRadius Auth / Linux
Remote MySQL / OSX
Stewie Radio Automation
Wireless Wandering Done Right
DynDNS: TinyDNS / OpenSSH
Xilinx WebPACK 6.3 / Wine
Xilinx WebPACK 7.1 / Debian
Apache 301 Redirection
Using Your Debian Cache
Google AdSense
Gnome AdSense Monitor
Pixlatch Gallery Generator
C#.NET Tips & Tricks
Ubuntu Breezy Clockmod Bug