debmirror
Mirror a Debian-style APT archive with the debmirror command. mirror.py maps
package settings to command-line arguments, discovers omitted distributions,
components, and architectures on every run, and delegates the complete job to
the worker.
Install debmirror on the worker host. Rsync transport and rsync-based
discovery also require rsync. Each worker run supplies an empty private
debmirror config, so system and user debmirror.conf files cannot silently
change the generated command.
settings.src normally supplies the transport, host, and archive root, for
example https://deb.debian.org/debian. Supported transports are http,
https, ftp, rsync, and file. A file: source must use an absolute local
path and an empty or localhost authority. settings.dst must be an absolute
path.
Repository selection and verification
Option |
Type |
Default |
Required |
Description |
|---|---|---|---|---|
|
string |
URL scheme |
No |
Override the transport with |
|
string |
URL authority |
No |
Override the upstream host. Not accepted for the |
|
string |
URL path |
No |
Override the archive root. The |
|
string or list of strings |
discovered |
No |
Distributions to mirror. Comma-separated strings are accepted. |
|
string or list of strings |
discovered |
No |
Archive components to mirror. Comma-separated strings are accepted. |
|
string or list of strings |
discovered |
No |
Binary architectures to mirror. Comma-separated strings are accepted. |
|
bool |
|
No |
Include source packages. |
|
bool |
|
No |
Enable Release signature verification. |
|
absolute path or list of paths |
(none) |
Required operationally when GPG checks are enabled |
Pass trusted keyrings to debmirror. mirror.py warns when none is configured or a configured file is missing. |
|
bool |
|
No |
Pass |
|
bool |
|
No |
Pass |
When any of dist, section, or arch is omitted, mirror.py resolves that
selection from repository listings and Release metadata. Discovery prefers
InRelease, only falls back when it is absent, verifies metadata before using
it, deduplicates distribution aliases with identical Release content, and
refuses an automatically discovered distribution set that would remove an
existing distribution. Specify dist explicitly to narrow a mirror.
Content, transport, and cleanup options
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
One of |
|
string |
unset |
Debian package diff behavior: |
|
string or list of strings |
unset |
Extra rsync trees selected from |
|
bool |
|
Include Translation files. |
|
bool |
|
Download Contents files. |
|
string or list of strings |
unset |
Debian Installer distributions. |
|
string or list of strings |
unset |
Debian Installer architectures. |
|
string |
unset |
Proxy passed to debmirror. Whitespace is rejected. |
|
bool |
|
Use passive FTP. |
|
string |
unset |
FTP or rsync username. HTTP, HTTPS, and file credentials are ignored with a warning. |
|
string |
unset |
FTP password or |
|
string or list of strings |
unset |
Repeatable package exclusion regex. |
|
string or list of strings |
unset |
Repeatable package inclusion regex. |
|
string or list of strings |
unset |
Repeatable Debian section exclusion. |
|
string or list of strings |
unset |
Repeatable priority limit. |
|
string |
unset |
Native rsync option string used by debmirror and discovery. |
|
positive int |
debmirror default; |
Native timeout in seconds. Discovery lasts at least 300 seconds overall and bounds each operation by this value. |
|
bool |
|
Pass |
|
bool |
|
Pass |
Example
This entry is ready to place inside the top-level packages object:
"debian-bookworm": {
"name": "Debian Bookworm",
"id": "debian-bookworm",
"href": "/debian",
"synctype": "debmirror",
"syncrate": "PT6H",
"link": [{ "rel": "HOME", "href": "https://www.debian.org/" }],
"settings": {
"hidden": false,
"src": "https://deb.debian.org/debian",
"dst": "/srv/mirror/debian",
"options": {
"dist": ["bookworm", "bookworm-updates"],
"section": ["main", "contrib", "non-free", "non-free-firmware"],
"arch": ["amd64", "arm64"],
"source": false,
"check_gpg": true,
"keyring": "/usr/share/keyrings/debian-archive-keyring.gpg",
"cleanup": "postcleanup",
"rsync_extra": "none"
}
}
}
Use a separate package and destination for Debian Security because it has a different repository root and distribution names.