Hello everyone, I decided to create a mirror of Ubuntu as I am working on a solution built on top of it, and I became quite tired of constantly building from repositories only or using the local cache of packages which often led to more downloading due to missing packages. So an easy option was to take advantage of a tool built for Ubuntu and Debian called apt-mirror.
Prior to installing apt-mirror is planning out how you will store your repositories and what repositories you are going to need. I am planning on storing everything in /var since I have placed /var on a raid array. since the default location is /var/spool/apt-mirror I will not have to change the “base_path” in the apt-mirror mirror.list configuration file.
I used the default mirror.list configuration file for apt-mirror only adding what was needed to support 64-bit and network installation. This file is located at /etc/apt/mirror.list and below is my mirror.list file:
############# config ##################
#
set base_path /var/spool/apt-mirror
set cleanscript $var_path/clean.sh
set nthreads 4
set _tilde 0
#set limit_rate 10k - Trickle updates down at 100Kbps to prevent network hogging
#
############# end config ##############
#Ubuntu Lucid 10.04 (32-bit)
deb-i386 http://archive.ubuntu.com/ubuntu lucid main restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu lucid-security main restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse
#Ubuntu Lucid 10.04 (64-bit)
deb-amd64 http://archive.ubuntu.com/ubuntu lucid main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu lucid-security main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu lucid-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu lucid-backports main restricted universe multiverse
#Ubuntu Lucid 10.04 (Source)
deb-src http://archive.ubuntu.com/ubuntu lucid main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu lucid-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu lucid-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu lucid-backports main restricted universe multiverse
#Security Updates (32-bit)
deb-i386 http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-i386 http://security.ubuntu.com/ubuntu lucid-security universe
deb-i386 http://security.ubuntu.com/ubuntu lucid-security multiverse
#Security Updates (64-bit)
deb-amd64 http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-amd64 http://security.ubuntu.com/ubuntu lucid-security universe
deb-amd64 http://security.ubuntu.com/ubuntu lucid-security multiverse
#Security Updates (Source)
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
#Netboot Requuirement (32-bit/64-bit)
deb-i386 http://archive.ubuntu.com/ubuntu lucid main/debian-installer restricted/debian-installer universe/debian-installer multiverse/debian-installer
deb-amd64 http://archive.ubuntu.com/ubuntu lucid main/debian-installer restricted/debian-installer universe/debian-installer multiverse/debian-installer
#cleanup routine
clean http://archive.ubuntu.com/ubuntu
clean http://security.ubuntu.com/ubuntu
After modifying the mirror.list you can at this point add a cron job to run apt-mirror at a designated time or manually run it to control when updates happen on your network. I also have a separate mirror.list I pass to apt-mirror on a hourly cronjob for security updates separate since I actually pull normal package updates when I want to update. So running apt-mirror will update the packages on the system and cron will automatically pull the security updates on a constant basis. Then the auto-update daemon will grab those updates on the clients. So far everything is working, hopefully when someone needs to make netboot working this will help since the information was quite vague in regard into what package needed to be added since I assume when you add restricted it will add debian-installer. This simply isn't the case with Ubuntu's repositories at least when I tried it with apt-mirror.
Apparently I am not allowed to do that… »« Well I managed to neglect this page once again… I keep saying I’m going to fix that…