Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to set up a local mirror for 12.04 LTS and 14.04 LTS on our local public library's server. Our town has no real broadband internet (most people are on either Dial-up or Satilite, with limited downloads). The local library has a 10MBit (fiber) connection and some 'spare' disk space. I have install debmirror and created a pair of scripts like this (the other script is the same, but for 14.04 [Trusty]):

#!/bin/bash
here=`pwd`
cd `dirname $0`
there=`pwd`
cd $here
arch=amd64,i386
section=main,restricted,universe,multiverse
release=precise
server=us.archive.ubuntu.com
inPath=/ubuntu
proto=http
echo $here
echo $there
outpath=`dirname $there`/precise
echo $outpath
debmirror       -a $arch \
            --no-source \
            -s $section \
            -h $server \
            -d $release \
            -r $inPath \
            --ignore-release-gpg \
    --progress \
            --no-check-gpg \
            -e $proto \
            $outpath

section=main,restricted,universe,multiverse
release=precise-updates
server=us.archive.ubuntu.com
inPath=/ubuntu
proto=http
echo $here
echo $there
outpath=`dirname $there`/precise-updates
echo $outpath
debmirror       -a $arch \
            --no-source \
            -s $section \
            -h $server \
            -d $release \
            -r $inPath \
            --ignore-release-gpg \
    --progress \
            --no-check-gpg \
            -e $proto \
            $outpath

section=main,restricted,universe,multiverse
release=precise-security
server=security.ubuntu.com
inPath=/ubuntu
proto=http
echo $here
echo $there
outpath=`dirname $there`/precise-security
echo $outpath
debmirror       -a $arch \
            --no-source \
            -s $section \
            -h $server \
            -d $release \
            -r $inPath \
            --ignore-release-gpg \
    --progress \
            --no-check-gpg \
            -e $proto \
            $outpath

section=main,restricted,universe,multiverse
release=precise-backports
server=us.archive.ubuntu.com
inPath=/ubuntu
proto=http
echo $here
echo $there
outpath=`dirname $there`/precise-backports
echo $outpath
debmirror       -a $arch \
            --no-source \
            -s $section \
            -h $server \
            -d $release \
            -r $inPath \
            --ignore-release-gpg \
    --progress \
            --no-check-gpg \
            -e $proto \
            $outpath

My question is: Is the the right way to do it effiencently? Should I 'merge' this into a single call to debmirror (i.e. append all of the 'release' options into a single comma separated list)?

What I am doing reflects how I have done this sort of thing for CentOS, but Ubuntu seems different, in that there are not actually separate trees of package files for different releases and different parts of the release (eg base OS, updates, contrib, extra, etc.) -- it is all 'munged' together, with the repository metadata being used to sort things out.

Any useful advice?

share|improve this question

1 Answer 1

I think you should use apt-mirror for this. It features a much simpler configuration (similar to /etc/apt/sources.list). Then, at the end of the each mirror, where you put the main,multiverse, etc., mention only those sections you want. I think main, universe, etc. are the Debian-derivative parallels of base, contrib, etc. apt-mirror also installs a cron entry, so you only have to uncomment it for the mirror to be updated regularly. You can also choose to add or ignore the -updates, -backports, and -proposed sections.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.