Debmirror – Ein Werkzeug zum Spiegeln von Debian-Paketarchiven / Debmirror - A Tool to mirror Debian Package Archives
Debmirror – Ein Werkzeug zum Spiegeln von Debian-Paketarchiven
(English Below / Englisch unten)
Debmirror ist ein Kommandozeilenprogramm, das entwickelt wurde, um vollständige oder teilweise Kopien von Debian-Paketarchiven anzulegen und aktuell zu halten. Es richtet sich vor allem an Personen, Bildungseinrichtungen und Unternehmen, die einen lokalen Spiegel (Mirror) eines Debian-Repositorys betreiben möchten. Ein solcher lokaler Spiegel bietet einige Vorteile, er reduziert den Internetverkehr, beschleunigt Softwareinstallationen innerhalb eines Netzwerks und ermöglicht den Zugriff auf Pakete auch dann, wenn die Internetverbindung eingeschränkt oder nicht verfügbar ist.
Das Programm arbeitet, indem es die Struktur eines Debian Repositorys analysiert und anschließend nur die gewünschten Dateien vom Quellserver herunterlädt. Dabei werden sowohl Paketdateien als auch Metadaten berücksichtigt. Debmirror unterstützt verschiedene Übertragungsprotokolle wie HTTP, HTTPS, FTP und rsync.
Ein wesentlicher Vorteil von debmirror besteht in seiner Flexibilität. Der Benutzer kann genau festlegen, welche Bestandteile des Repositorys gespiegelt werden sollen. So lassen sich beispielsweise nur bestimmte Debian Versionen wie "stable", "testing" oder "unstable“ auswählen. Ebenso können einzelne Architekturen wie amd64, arm64 oder i386 eingeschlossen oder ausgeschlossen werden. Auch die Auswahl bestimmter Repository Bereiche, etwa "main", "contrib" oder "non-free", ist möglich. Dadurch kann der benötigte Speicherplatz erheblich reduziert werden, wenn nur ein Teil des gesamten Archivs benötigt wird.
Debmirror prüft während der Synchronisation die Integrität der heruntergeladenen Daten. Es verwendet die von Debian bereitgestellten Prüfsummen und Metadateien, um sicherzustellen, dass die Dateien vollständig und unverändert übertragen wurden. Zusätzlich kann das Programm nicht mehr benötigte Pakete automatisch entfernen, sodass der lokale Spiegel den Zustand des Original Repositorys möglichst exakt widerspiegelt.
Die Bedienung erfolgt ausschließlich über die Kommandozeile. Obwohl dies zunächst komplex erscheinen kann, ermöglicht dieser Ansatz eine einfache Automatisierung. Administratoren können debmirror beispielsweise regelmäßig über Cronjobs oder andere Aufgabenplaner ausführen lassen.
Trotz seiner Leistungsfähigkeit besitzt debmirror auch einige Einschränkungen. Das Programm setzt ein grundlegendes Verständnis der Debian Repository Struktur voraus, und die Vielzahl an Optionen kann für Einsteiger zunächst unübersichtlich sein. Zudem benötigt ein vollständiger Spiegel des Debian Archivs mehrere Terabyte Speicherplatz, weshalb in der Praxis häufig nur ausgewählte Bereiche synchronisiert werden.
Es folgen Beispiele für den Programmaufruf.
- Soll für die Version 11 alle Packete fuer die amd64 und i386 Architektur inclusive der Source Packete geladen werden.
- Für die Version 12 sollen alle Packete der amd64 und i386 Architektur (ohne Sourcescode) geladen werden.
- und 4. fuer die Versionen 13 und 14 nur die amd64 Architektur.(ohne Sourcecode)
1. Debian 11(bullseye) - Platzbedarf ca 130GB(Nur Binary) oder 204GB(Binary und Source)
debmirror --keyring=/usr/share/keyrings/debian-archive-keyring.gpg --getcontents --method=http --arch=amd64,i386 --dist=bullseye,bullseye-updates --source --i18n --host=ftp.de.debian.org --rsync-extra=doc,tools --di-dist=bullseye --di-arch=amd64,i386 --checksums -verbose -progress /home/user/debian11-repo
2. Debian12(bookworm) - Platzbedarf ca 200GB(Nur Binary)
debmirror --keyring=/usr/share/keyrings/debian-archive-keyring.gpg --getcontents --method=http --arch=amd64,i386 --dist=bookworm,bookworm-updates,bookworm-backports,bookworm-backports-sloppy --nosource --i18n --host=ftp.de.debian.org --rsync-extra=doc,tools --di-dist=bookworm --di-arch=amd64,i386 --checksums -verbose -progress /home/user/debian12-repo
3. Debian13(Trixie) - Platzbedarf ca 250GB(Nur Binary)
debmirror --keyring=/usr/share/keyrings/debian-archive-keyring.gpg --getcontents --method=http --arch=amd64,i386 --dist=trixie,trixie-updates,trixie-backports,trixie-backports-sloppy --nosource --i18n --host=ftp.de.debian.org --rsync-extra=doc,tools --di-dist=trixie --di-arch=amd64,i386 --checksums -verbose -progress /home/user/debian13-repo
4. Debian14(forky)
debmirror --keyring=/usr/share/keyrings/debian-archive-keyring.gpg --getcontents --method=http --arch=amd64 --dist=forky,forky-updates,forky-backports --nosource --i18n --host=ftp.de.debian.org --rsync-extra=doc,tools --di-dist=forky --di-arch=amd64 --checksums -verbose -progress /home/user/debian14-repo
Den Bereich backports-sloopy gibt es bei Debian 14 derzeit noch nicht.
Normalerweise lade ich die Spiegel immer ohne Sourcen. Ausnahme ist derzeit Debian 11. Da bei dieser Version der End Of Life Termin nahe ist(31.08.2026) wird der Spiegel vermutlich kurz danach von den Offiziellen Debian Servern verwschwinden. Danach ist es, wenn überhaupt, noch möglich schwierig an die Quellpackete zu kommen.
English Version
Debmirror - A Tool to mirror Debian Package Archives
Debmirror is a command-line program designed to create and maintain complete or partial copies of Debian package archives. It is primarily intended for individuals, educational institutions, and companies that want to operate a local mirror of a Debian repository. Such a local mirror offers several advantages: it reduces Internet traffic, speeds up software installations within a network, and provides access to packages even when the Internet connection is limited or unavailable.
The program works by analyzing the structure of a Debian repository and then downloading only the requested files from the source server. Both package files and metadata are taken into account. Debmirror supports various transfer protocols such as HTTP, HTTPS, FTP, and rsync.
One of the main advantages of debmirror is its flexibility. The user can specify exactly which parts of the repository should be mirrored. For example, only specific Debian releases such as "stable", "testing", or "unstable" can be selected. Individual architectures such as amd64, arm64, or i386 can also be included or excluded. It is also possible to select specific repository components, such as "main", "contrib", or "non-free". This can significantly reduce the required storage space if only part of the complete archive is needed.
During synchronization, debmirror checks the integrity of the downloaded data. It uses the checksums and metadata provided by Debian to ensure that the files have been transferred completely and without modification. In addition, the program can automatically remove packages that are no longer required, allowing the local mirror to reflect the state of the original repository as accurately as possible.
The program is operated exclusively via the command line. Although this may initially appear complex, this approach makes automation straightforward. For example, administrators can run debmirror regularly using cron jobs or other task schedulers.
Despite its capabilities, debmirror also has some limitations. The program requires a basic understanding of the Debian repository structure, and the large number of available options can initially be confusing for beginners. In addition, a complete mirror of the Debian archive requires several terabytes of storage space, which is why only selected parts are often synchronized in practice.
The following are examples of how the program can be invoked:
- Debian 11, all packages for the amd64 and i386 architectures, including the source packages, should be downloaded.
- Debian 12, all packages for the amd64 and i386 architectures should be downloaded, but without the source packages.
- and 4. For Debian 13 and Debian 14, only the amd64 architecture should be downloaded, without the source packages.
1. Debian 11(bullseye) - Disk Space Requirement approximately 130GB(Binary Only) or 204GB(Binary + Source)
debmirror --keyring=/usr/share/keyrings/debian-archive-keyring.gpg --getcontents --method=http --arch=amd64,i386 --dist=bullseye,bullseye-updates --source --i18n --host=ftp.de.debian.org --rsync-extra=doc,tools --di-dist=bullseye --di-arch=amd64,i386 --checksums -verbose -progress /home/user/debian11-repo
2. Debian12(bookworm) - Disk Space Requirement approximately 200GB(Binary Only)
debmirror --keyring=/usr/share/keyrings/debian-archive-keyring.gpg --getcontents --method=http --arch=amd64,i386 --dist=bookworm,bookworm-updates,bookworm-backports,bookworm-backports-sloppy --nosource --i18n --host=ftp.de.debian.org --rsync-extra=doc,tools --di-dist=bookworm --di-arch=amd64,i386 --checksums -verbose -progress /home/user/debian12-repo
3. Debian13(Trixie) - Disk Space Requirement approximately 250GB(Binary Only)
debmirror --keyring=/usr/share/keyrings/debian-archive-keyring.gpg --getcontents --method=http --arch=amd64,i386 --dist=trixie,trixie-updates,trixie-backports,trixie-backports-sloppy --nosource --i18n --host=ftp.de.debian.org --rsync-extra=doc,tools --di-dist=trixie --di-arch=amd64,i386 --checksums -verbose -progress /home/user/debian13-repo
4. Debian14(forky)
debmirror --keyring=/usr/share/keyrings/debian-archive-keyring.gpg --getcontents --method=http --arch=amd64 --dist=forky,forky-updates,forky-backports --nosource --i18n --host=ftp.de.debian.org --rsync-extra=doc,tools --di-dist=forky --di-arch=amd64 --checksums -verbose -progress /home/user/debian14-repo
backports-sloopy is not availiable in Debian 14 at this time.
Normally, I always create the mirrors without source packages. My current exception is Debian 11. Since this version is approaching its End-of-Life date (August 31, 2026), the mirror will presumably disappear from the official Debian servers shortly afterwards. After that, obtaining the source packages may become difficult, if it is still possible at all.