ubumirror.pl is a simple Perl script to create and maintain functional Ubuntu distribution mirror to aid networked installation and update process. Please use apt-mirror for more general solution.
Not required, just ensure you have a working wget and the following Perl modules:
These are rather common and may be available in the perl package or separate packages from your distribution.
A handy boilerplate Makefile is included in the tar.bz2 distribution to check module availability and copy ubumirror.pl to /usr/local/bin/.
All the configuration is done through the command line. To get a short help on supported switches and default values use --help.
-v option is strongly recommended for interactive use, not much output without it (TODO: add timestamps to messages).
The only required parameter is distribution/repository specification, e.g. lucid/main. For minimal mirror suitable for installation call ubumirror.pl like that:
ubumirror.pl lucid{,-updates,-security}/{main,restricted}
Note the shell expansion in action, this command can be also specified like the following:
ubumirror.pl lucid/main lucid/restricted \ lucid-updates/main lucid-updates/restricted \ lucid-security/main lucid-security/restricted
You can also try to mirror updates only:
ubumirror.pl lucid-{updates,security}/{main,restricted}
(however I didn't test this)
Put something like that in your crontab to run daily or hourly or whatever you like.
Make the mirror directory available through a web server and note the base URL, say, http://server.lan/mirrors/ubuntu/.
Put something like that in your /etc/apt/sources.list:
deb http://server.lan/mirrors/ubuntu/ lucid main restricted
deb http://server.lan/mirrors/ubuntu/ lucid-security main restricted
deb http://server.lan/mirrors/ubuntu/ lucid-updates main restricted
Delete (or better comment out) references to the default Ubuntu archive specifications.
Update package indices - for example with apt-get update.