redirect apt to local repository

Carl Karsten carl at personnelware.com
Thu Apr 14 00:35:31 UTC 2005


Matt Price wrote:
> I think I postedo n this a while ago but got no responses.
> 
> Using debmirror, I've downloaded a mirror of the hoary repository to
> a hard drive.  It works fine in my /etc/apt/sources.list when added
> with a "file://" url.  
> 
> now, the tricky part.  I wantto deploy this mirror in a classroom
> that's not hooked up to the internet.  We will have a bunch of
> computers ocnnected to a router (running debian, could be ubuntu if
> that makes anything easier, actually haven't set this bit up yet --
> any suggestions?), and therefore a local network that I hope will work
> fine.  The computers in the network, though, will at some point be
> removed from the network and taken into people's homes.  So I would
> like to LEAVE sources.list POINTING TO http://archive.ubuntu.com , and
> somehow use the router to fool the ocmputers into thinking that they
> are connecting to ubuntu when in fact they're accessing my local
> repository.
> 
> 
> sooo... how would one do this?  first guess:
> 
> in /etc/hosts on the router add a line like:
> 
> 127.0.0.1    archive.ubuntu.com 
> 
> in /etc/apache/httpd.conf:
> 
> <VirtualHost 127.0.0.1>
>     ServerName archive.ubuntu.com
>     DocumentRoot /path/to/archive/mirror
> </VirtualHost>
> 
> does that sound about right?  I guess maybe the individual machines
> have to be set to use the router as a DNS server... which means
> probably the bit about /etc/hosts is far too simplistic...  
> 
> anyway any ideas anyone has are vvvveeeeerrry welcome.
> 

Well, here are some ideas...

First, if you arn't connected to the Net, you can do whatever you want 
with a name server and gateway - they don't have to play right like they 
would if they were connected to the net - and even if they were, you can 
still play games, it just gets extra confusing.

Anyway, I am guessing your "dhcp/web/DNS/whatever server" will be the 
one "big box" that sits at the front of the class and all the boxes are 
hooked to it - hub, whatever.

The student boxes will do dhcp - you don't even need a gateway, but I 
think the installer gets cranky if dhcp doesn't supply one.

Your DNS server just has to serve up one name:
archive.ubuntu.com  192.168.1.1 - so setup bind to do that (I'll leave 
that one for your, cuz I don't know how.)  You might even want to config 
  the boxes for a mirror: like us.archive.ubuntu.com - that can be 
192.168.1.1 too. I know some DNS's that will return a single IP for any 
request.

That is all you need.

heh - I didn't think it was going to be this easy.

So.. lets make it fun:  Skip burning a stack of CD's and do 
https://www.ubuntulinux.org/wiki/LocalNetInstall

Of course that doesn't give the students the same experience.

Carl K




More information about the ubuntu-users mailing list