]> git.proxmox.com Git - proxmox-offline-mirror.git/blob - docs/offline-mirror.rst
c5f03c1911890c7f14d88ae02ebac6ab11b10726
[proxmox-offline-mirror.git] / docs / offline-mirror.rst
1 Offline Repository Mirrors
2 ==========================
3
4 Offline repository mirrors are pointing to APT repositories, for example from Proxmox VE, Proxmox
5 Backup Server or Debian. After the initial setup, you can mirror all the available packages locally.
6 They are organized by creating point-in-time snapshots of the repositories. Those snapshots can then
7 be exported to a configured medium.
8
9 Setting Up a Mirror
10 -------------------
11
12 First, either run the ``setup`` wizard (``proxmox-offline-mirror setup``), or the
13 ``config mirror add`` command.
14
15 .. tip:: The quickest way to set up all relevant repositories for a Proxmox solution is to use the
16 ``setup`` wizard. Choose the product when adding a mirror and confirm the question regarding
17 auto-adding the Debian base repos.
18
19 For example, to manually add a mirror entry for the Debian Bullseye security repository, the
20 following command can be used:
21
22 .. code-block:: console
23
24 proxmox-offline-mirror config mirror add \
25 --id debian-bullseye-security \
26 --architectures amd64 \
27 --architectures all \
28 --repository 'deb http://deb.debian.org/debian-security bullseye-security main contrib non-free' \
29 --key-path /etc/apt/trusted.gpg.d/debian-archive-bullseye-security-automatic.gpg \
30 --sync true \
31 --verify true \
32 --dir /path/to/mirror/dir/debian-bullseye-security
33
34 .. note:: The `all` architecture is meant for architecture independent packages, not for all
35 possible architectures. It is usually always sensible to add it in addition to the host-specific
36 architecture.
37
38 Syncing a Mirror
39 ----------------
40
41 To create the first (and subsequent) snapshots, the following command can be used:
42
43 .. code-block:: console
44
45 proxmox-offline-mirror mirror snapshot create debian-bullseye-security
46
47 .. note:: Depending on the parameters used and the size of the original repository, creating a
48 snapshot can take both time and require significant disk space. This is especially true for the
49 initial snapshot, as subsequent ones will re-use unchanged package files and indices.
50
51 Space Management
52 ----------------
53
54 After removing a snapshot with ``proxmox-offline-mirror mirror snapshot remove``, a
55 ``proxmox-offline-mirror mirror gc`` invocation is needed to trigger the garbage collection to
56 actually remove any contents from the underlying hard link pool that are no longer needed.