debian mirror

Stephan Hermann sh at sourcecode.de
Fri Jul 16 10:50:29 CEST 2010


On Thu, 2010-07-15 at 17:26 +0000, mamadou diop wrote:
> How are you? who can give me the mkdebmirror script for Ubuntu jaunty?
> 

I don't know what mkdebmirror script is but my personal script for
debmirroring ubuntu distros is this:

#!/bin/bash

dist=`basename $0|cut -f2 -d "_"` 
DEST=/srv/mirrors
if [ ! -d ${DEST} ]; then
	mkdir -p ${DEST}
fi
if [ ! -d ${DEST}/${dist} ]; then
mkdir -p ${DEST}/${dist}
fi

case "$dist" in 

"dapper"|"edgy"|"feisty"|"gutsy"|"hardy"|"intrepid"|"jaunty"|"karmic"|"lucid" )
                dist_all="$dist,$dist-security,$dist-updates"
                arch="amd64,i386"
                host="archive.ubuntu.com"
                rootdir="--root=ubuntu"
                ;;
        "lpia"  )
                dist_all="hardy"
                arch="lpia"
                host="ports.ubuntu.com"
                rootdir="--root=/"
                ;;
        * )
                dist_all="$dist"
                arch="amd64,i386"
                host="archive.ubuntu.com"
                rootdir="--root=ubuntu"
                ;;
esac

debmirror --progress --verbose --nosource --host=$host --method=http
$rootdir --dist=$dist_all --section=main,restricted,universe,multiverse
--arch=$arch  $DEST/$dist


the mirrors are located under /srv/mirrors/<ubuntu-release-name like
lucid>

Regards,

\sh



More information about the linux-fai mailing list