Table of Contents

apt-mirror

Summary

Serves as DEB and RPM repo mirrors. See apt-mirror's project page

Lives on gitbuilder-archive.

apt-mirror.sh

Called by root's crontab every day at 4PM Pacific time.

# cat /home/apt-mirror/apt-mirror.sh
#!/bin/bash
echo > /var/spool/apt-mirror/var/cron.log
for file in /etc/apt/mirrors/*.list
do
	cp -avf $file /etc/apt/mirror.list
	sleep 5
	/usr/bin/apt-mirror >> /var/spool/apt-mirror/var/cron.log
done

/bin/repomirror.sh

Called by root's crontab every day at 6PM Pacific time.

root@gitbuilder-archive:~# cat /bin/repomirror.sh | egrep -v "(^#.*|^$)"
tmp=/tmp/temprpm
rm -Rf $tmp 2> /dev/null
mkdir $tmp
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/usr/sbin/chroot /images/rhel7 <<EOF
reposync -q -d -l --repoid=epel --download_path=/home/apt-mirror/mirror/epel7
createrepo /home/apt-mirror/mirror/epel7
EOF
rsync -av --delete-after /images/rhel7/home/apt-mirror/mirror/epel7/ /home/apt-mirror/mirror/epel7/
rsync -aHS --delete-after  --delay-updates rsync://mirrors.kernel.org/centos/ /home/apt-mirror/mirror/centos/

Common Problems

Hash checksum mismatch

This can happen when an upstream Ubuntu repo is modified while apt-mirror is running. Re-run apt-mirror.sh to resync the repos.

This can also happen when there is an inconsistency in the upstream repo. See http://tracker.ceph.com/issues/15459

Hacks

https://github.com/djgalloway/apt-mirror/commit/efebe269a8c2d6a776d337f82f70a9b434c1b186