To use debmirror to update using rsync which will create a local mirror for the following:
- arch: amd64 and all
- dists: jessie, jessie-updates, stretch, stretch-updates, and sid
- sections: main and main/debian-installer
- check signatures using the debian-archive-keyring gpg keyring
- include sources
- store mirror in /var/www/html/debian/ directory
- use lighttpd to export a /debian/ directory holding the contents
- use /etc/debmirror.conf to define options
debmirror --keyring=/usr/share/keyrings/debian-archive-keyring.gpg
Mirroring oldstable, stable, testing, and unstable (along with repsective -updates) dists is about 270 GB. Removing oldstable from the list is about 210 GB.
Idea is to do one big first sync on a fast connection which may take a few hours, and then be able to do smaller daily syncs on my slow home connection to just get what's changed every night.
Using DNS on my home network, return the IP address of the local mirror for lookups of httpredir.debian.org and make sure all Debian machines are using that for their apt fetching needs. This will allow devices to not realize they're pulling from a local mirror and not the actual httpredir.debian.org round robin mirror system.
For the main section mirroring like this, to support getting contrib and non-free from the web from some other mirror, we can just call out another "deb" line in apt.conf which doesn't use httpredir.debian.org.
Do a sync of the mirror every night at 11:15 pm, in crontab put:
# Every night at 11:15 pm, update local debmirror and pipe output to syslog/journal
15 23 * * * /usr/bin/debmirror --keyring=/usr/share/keyrings/debian-archive-keyring.gpg | /usr/bin/logger -t debmirror
Need to enable the dir-listing module in lighttpd. Setup mirror at /var/www/html/debian/ directory.
Don't create the /var/www/html/debian directory, just let rsync do it, but make sure that the user/group running debmirror has write ability to /var/www/html/ directory.