UEC Provisioning greatly benefits from a local Ubuntu Mirror, as installations are performed over the network. Over a gigabit local connection, this can take as little as 5 minutes per machine installation.
A full Ubuntu mirror of all supported packages and all supported architectures requires ~350GB.
Please see the Ubuntu Wiki for information about mirroring Ubuntu. For unofficial mirrors; please use a local mirror instead of the primary ones for the UBUARC_MIRROR and UBUREL_MIRROR variables.
Install Ubumirror
sudo apt-get install ubumirror
Configure Ubumirror
sudo vi /etc/ubumirror.conf
# # ubumirror.conf - configuration file for the ubumirror scripts. # # Please set the variables below to fit your site. # Which email address/user that will receive failure notices. EMAIL=root@localhost # Server's FQDN. HOSTNAME=$(hostname -f) # Bandwidth limit for all mirror scripts - set to 0 for no limit. SPEED=0 # UBUARC_DIR is the destination for the base of the archive directory # The script won't run if this variable isn't set UBUARC_DIR="/srv/mirror/ubuntu" # UBUCDI_DIR is the destination for the base of the cdimage directory # The script won't run if this variable isn't set UBUCDI_DIR="/srv/mirror/ubuntu-cdimage" # UBUREL_DIR is the destination for the base of the releases directory # The script won't run if this variable isn't set UBUREL_DIR="/srv/mirror/ubuntu-releases" # UBUPOR_DIR is the destination for the base of the ports directory # The script (ubuports) won't run if this variable isn't set UBUPOR_DIR="/srv/mirror/ubuntu-ports" # LOGDIR is the destination directory of all the logs LOGDIR="/var/log/ubumirror/" # UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form of host::directory/ of the # upstream mirrors where the ubumirror scripts will mirror from. UBUARC_MIRROR=archive.ubuntu.com::ubuntu/ UBUCDI_MIRROR=cdimage.ubuntu.com::cdimage/ UBUREL_MIRROR=rsync.releases.ubuntu.com::releases/ UBUPOR_MIRROR=ports.ubuntu.com::ubuntu-ports/ # UBUCDI_FLAVOURS is the set of image flavours to pull from UBICDI_MIRROR # flavour names must match directory names on the mirror UBUCDI_FLAVOURS="\ daily daily-live \ ubuntu-netbook/daily-live ubuntu-server/daily \ " # UBU{ARC,CDI,REL}_EXCLUDE is what things you want to exclude UBUARC_EXCLUDE="\ --exclude binary-powerpc/ --exclude binary-sparc/ \ --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \ --exclude installer-powerpc/ --exclude installer-sparc/ \ --exclude *_powerpc.deb --exclude *_powerpc.udeb \ --exclude *_sparc.deb --exclude *_sparc.udeb \ --exclude Contents-powerpc.gz --exclude Contents-sparc.gz \ " UBUCDI_EXCLUDE="\ --exclude *-powerpc.* --exclude *-sparc.* \ --exclude source/ \ " UBUREL_EXCLUDE="\ --exclude *-powerpc.* --exclude *-sparc.* \ " UBUPOR_EXCLUDE="\ --exclude binary-powerpc/ --exclude binary-sparc/ \ --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \ --exclude installer-powerpc/ --exclude installer-sparc/ \ --exclude *_powerpc.deb --exclude *_powerpc.udeb \ --exclude *_sparc.deb --exclude *_sparc.udeb \ --exclude Contents-powerpc.gz --exclude Contents-sparc.gz \ "
Run Ubumirror
Check available space in /srv, ensure that you have ~350GB free.
df -h /srv
Then run the mirror commands. On the first run, this may take many hours or several days (depending on your network connectivity). Ideally, you would seed this mirror from someone nearby you who has an up-to-date mirror.
sudo ubuarchive sudo uburelease
Configure to Run in Crontab
This will update your archive every 6 hours. Configure according to your needs.
echo "21 */6 * * * root ubumirror /usr/bin/ubuarchive >/dev/null" | sudo tee -a /etc/crontab
Serve Your Mirror over HTTP
sudo apt-get install apache2 sudo ln -s /srv/mirror/ubuntu /var/www