Skip to main content

arch-mirror-downloader

Ships consistent snapshots of the Arch Linux repos, plus packages built from the AUR, local or git PKGBUILDs, to an airgapped mirror through a one-way path, from a host with a small disk. The other side is arch-mirror-receiver.

Each sync:

  1. Builds the AUR/local/git packages first, in throwaway docker containers, against live upstream.
  2. Fetches all repo databases until a round starts and ends on the same upstream lastupdate.
  3. Downloads (over http(s), as pacman, 5 at a time) every package version not moved before, checks each against its database sha256, and appends it to the chunk being filled.
  4. A full chunk (chunk_limit) is closed and moved to the outbox; the last one adds the AUR repo, the databases and the snapshot's file list.

A chunk is chunk_magic (4 bytes) + a tar whose last member, message.json, lists every file with its sha256. Files are named <chunk_prefix><YYYYmmdd-HHMMSS>-<seq><chunk_suffix> (UTC; unique even after a reset). A sqlite db in root records the newest version of each package that has left (written only after its chunk moved), so reruns fetch only what's new, and an interrupted run continues the open chunk.

Local disk needed: chunk_limit + batch_size + about 1 GB of databases + docker storage for the builds.

Install

sudo useradd --system --home-dir /var/lib/arch-mirror-downloader --groups docker arch-mirror
sudo UV_TOOL_DIR=/opt/uv-tools UV_TOOL_BIN_DIR=/usr/local/bin uv tool install arch-mirror-downloader
arch-mirror-downloader default-config | sudo install -Dm644 /dev/stdin /etc/arch-mirror-downloader/config.yaml   # then edit
sudo install -m644 systemd/arch-mirror-downloader.{service,timer} /etc/systemd/system/
sudo systemctl daemon-reload && sudo systemctl enable --now arch-mirror-downloader.timer

default-config prints every setting with its default and what it does. The units in systemd/ are in the repository. The outbox must be writable by the arch-mirror user.

Use

arch-mirror-downloader sync            # what the timer runs; progress bars on a terminal
arch-mirror-downloader status          # last snapshot shipped, packages moved, open chunk
arch-mirror-downloader rank            # which upstreams carry every repo, fastest first
arch-mirror-downloader reset           # forget what was shipped; next sync sends everything
arch-mirror-downloader default-config  # commented default config (YAML) on stdout
arch-mirror-downloader --install-completion   # tab completion for your shell (bash, zsh, fish)

-c/--config (or ARCH_MIRROR_DOWNLOADER_CONFIG) picks another config. Exit status: 0 shipped or nothing new, 2 shipped but an AUR build failed (that package keeps its previous build), 1 no upstream could deliver.

arch-mirror-downloader reset forgets what was shipped: the next sync downloads and ships the whole mirror again, and the receiver takes it as a fresh snapshot. Use it if a chunk was lost on the way, or to test. --aur also drops the AUR builds, so all are rebuilt.

Metadata

Release files for arch-mirror-downloader 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arch-mirror-downloader 0.1.1
File Size Uploaded Provenance Actions
arch_mirror_downloader-0.1.1.tar.gz 19.7 kB Without provenance Details for arch_mirror_downloader-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for arch-mirror-downloader 0.1.1
File Interpreter ABI Platform Actions
arch_mirror_downloader-0.1.1-py3-none-any.whl Python 3 none any Details for arch_mirror_downloader-0.1.1-py3-none-any.whl

Total release size: 43.5 kB

Release files / arch_mirror_downloader-0.1.1.tar.gz

Download URL arch_mirror_downloader-0.1.1.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
73099476295c8466e41fedeb9b954898d20f9a21cfd637eff6522c5cb257ce0a
BLAKE2b-256 checksum
How to use checksums
74e53875b80518c2c38d6f98e27b0cdb87739b56fd3d5508e8d9ba563f76b48f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / arch_mirror_downloader-0.1.1-py3-none-any.whl

Download URL arch_mirror_downloader-0.1.1-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37732cfc2b22e47523cc57214ba8616f83dd1eb48f510dbe555bb0e4e863f259
BLAKE2b-256 checksum
How to use checksums
90f6ecb6e59f512a00c93974089e0e60bdfd7602dc2010c6403617c53d374336
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for arch-mirror-downloader 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page