Recently I was searching a tool to mirror the complete debian wheezy package repository and some smaller repos for snapshotting them for our internal systems.
Most tools I have looked at where somehow arcane, difficult to comprehent or lacks a usable documentation.
Aptly on the other hand had some usefull tutorials on its website and let me setup a local mirror for debian wheezy in under one hour, that was really impressive.
$ aptly mirror create -architectures=amd64 -filter='Priority (required) | Priority (important) | Priority (standard)' jessie-main http://ftp2.de.debian.org/debian/ jessie main gpgv: Signature made Sa 07 Feb 2015 09:55:08 CET using RSA key ID 46925553 gpgv: Good signature from "Debian Archive Automatic Signing Key (7.0/wheezy) <email@example.com>" Mirror [jessie-main]: http://ftp2.de.debian.org/debian/ jessie successfully added. You can run 'aptly mirror update jessie-main' to download repository contents. $ aptly mirror update jessie-main Downloading http://ftp2.de.debian.org/debian/dists/jessie/InRelease... gpgv: Signature made Sa 07 Feb 2015 09:55:08 CET using RSA key ID 46925553 gpgv: Good signature from "Debian Archive Automatic Signing Key (7.0/wheezy) <firstname.lastname@example.org>" Downloading & parsing package files... Downloading http://ftp2.de.debian.org/debian/dists/jessie/main/binary-amd64/Packages.bz2... Downloading http://ftp2.de.debian.org/debian/dists/jessie/main/binary-amd64/Packages.gz... Applying filter... Packages filtered: 42434 -> 233. Building download queue... Download queue: 225 items (75.02 MiB) Downloading http://ftp2.de.debian.org/debian/pool/main/c/cpio/cpio_2.11+dfsg-4_amd64.deb... Downloading http://ftp2.de.debian.org/debian/pool/main/libn/libnfsidmap/libnfsidmap2_0.25-5_amd64.deb... [..] Downloading http://ftp2.de.debian.org/debian/pool/main/u/util-linux/mount_2.25.2-4.1_amd64.deb... Downloading http://ftp2.de.debian.org/debian/pool/main/t/texinfo/info_5.2.0.dfsg.1-6_amd64.deb... Downloading http://ftp2.de.debian.org/debian/pool/main/c/coreutils/coreutils_8.23-3_amd64.deb... Downloading http://ftp2.de.debian.org/debian/pool/main/w/whitedb/libwgdb0_0.7.2-1_amd64.deb... Mirror `jessie-main` has been successfully updated.
Beside the mirroring of existing repos aptly also supports to create own repos which can be easily published. I haven’d tries that yet, but I will give it definitifely a try.
One drawback is that you resign even the published mirrors with your own key so you have to find a way to distribute this key to all systems that are using your mirror but this should be addressed in on of the next versions.
Kudos to Andrey Smirnov.