Frozen mirror (with DebMirror and Scaramanga)

Jurjen Bokma

March 2011


Table of Contents

Single-stage frozen mirror

A frozen mirror is nice if you don't want unexpected updates on your machines. Building a frozen mirror is easy with Scaramanga (see Conference under Docker:

  1. We want to run a script instead of the default rsync command, so we specify which script to run in /etc/scaramanga/dists.d/ubuntu-frozen-testing:

    	    SCRIPT=ubuntu-frozen-testing
    	  

  2. That script is looked for relative to /etc/scaramanga/scripts.d, so we put in /etc/scaramanga/scripts.d/ubuntu-frozen-testing:

    #! /bin/bash
    
    CONFFILE=/etc/scaramanga/scaramanga.conf
    [ -f ${CONFFILE} ] && . ${CONFFILE}
    
    DST=ubuntu-frozen-testing
    
    BASEDIR=${DESTPARENT}/${DST}
    
    export GNUPGHOME=/var/lib/scaramanga/frozenmirror-keys/.gnupg
    
    # From the debmirror docs:
    #default rsync options are "-aIL --partial"
    
    debmirror --verbose --source --host=localhost --method=rsync --root=:Ubuntu --dist=lucid,lucid-updates,lucid-backports --section=main,restricted,universe,multiverse  --arch=amd64 --diff=use --rsync-options="-aIL --partial --no-motd" ${BASEDIR}
    	  

    (As you can see, this is a lucid-only, amd64-only frozen mirror)

  3. Copy /usr/share/keyrings/* from the package ubuntu-keyring to /var/lib/scaramanga/ubuntu-keyrings, and in /var/lib/scaramanga/frozenmirror-keys/.gnupg/, do: sudo ln -s ../../ubuntu-keyrings/ubuntu-archive-keyring.gpg trustedkeys.gpg

  4. Now we start the script with

    admin@server:~$ sudo -u scaramanga scaramanga -d ubuntu-frozen-testing

    (The same command is used to update the mirror when we temporarily thaw the mirror.)