Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creating a Debian Stable repository mirror
### SRC: https://gist.github.com/DaGoodBoy/6011765 ###
############# config ##################
# set base_path /var/spool/apt-mirror
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
# set cleanscript $var_path/clean.sh
##set _autoclean 1
set _autoclean 0
# set defaultarch <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set run_postmirror 1
##set limit_rate 1024k
set limit_rate 100k
#set nthreads 20
set nthreads 1
set _tilde 0
############# end config ##############
deb-amd64 http://ftp.debian.org/debian stable main/debian-installer main contrib non-free
deb-amd64 http://ftp.debian.org/debian stable-updates main/debian-installer main contrib non-free
#deb-amd64 http://ftp.debian.org/debian stable-backports main/debian-installer main contrib non-free
deb-amd64 http://security.debian.org/debian-security stable/updates main contrib non-free
deb-amd64  http://www.deb-multimedia.org stable main non-free
deb-src http://ftp.debian.org/debian stable main contrib non-free
deb-src http://ftp.debian.org/debian stable-updates main contrib non-free
#deb-src http://ftp.debian.org/debian stable-backports main contrib non-free
deb-src http://security.debian.org/debian-security stable/updates main contrib non-free
deb-src http://www.deb-multimedia.org stable main non-free
skip-clean http://ftp.debian.org/debian/dists/stable/main/installer-amd64
skip-clean http://ftp.debian.org/debian/dists/stable-proposed-updates/main/installer-amd64
clean http://ftp.debian.org/debian
clean http://security.debian.org/debian-security
clean http://deb-multimedia.org/
#### START /var/spool/apt-mirror/var/postmirror.sh ####
#!/bin/bash
SRC_BASE="rsync://mirrors.usc.edu/debian/dists"
DEST_BASE="/var/spool/apt-mirror/mirror/ftp.us.debian.org/debian/dists"
repo="wheezy wheezy-proposed-updates"
arch="amd64 i386"
for _repo in ${repo}; do
for _arch in ${arch}; do
/usr/bin/rsync --archive --verbose --compress --delete ${SRC_BASE}/${_repo}/main/installer-${_arch}/ ${DEST_BASE}/${_repo}/main/installer-${_arch}
done
done
repo="wheezy wheezy-backports wheezy-proposed-updates wheezy-updates"
section="contrib main non-free"
for _repo in ${repo}; do
for _section in ${section}; do
if [ -d ${DEST_BASE}/${_repo}/${_section} ]; then
cd ${DEST_BASE}/${_repo}/${_section}
if [ ! -d i18n ]; then
mkdir i18n
fi
cd i18n
rm -rf Translation-en*
wget -q http://ftp.us.debian.org/debian/dists/${_repo}/${_section}/i18n/Translation-en.bz2
cd ../../
fi
done
done
# End
#### END /var/spool/apt/var/postmirror.sh ####
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.