aptly-dev / aptly

aptly - Debian repository management tool
https://www.aptly.info/
MIT License
2.54k stars 369 forks source link

Mirroring and publishing repository with debian-installer and its images #1212

Open hiddenman opened 10 months ago

hiddenman commented 10 months ago

Can't find any useful information information how to mirror and publish a repository with debian-installer and its images

Detailed Description

  1. I have a local repository (published by aptly on the Host B) built from local packages. It has the same structure as official Debian repository, including debian-installer and installer-amd64 folders structure. Everything works fine with apt, live-build tools and so on, the folder structure and components are correct.
  2. I want to mirror this repository to the Host A, using aptly.
  3. If i create mirror like this:
    aptly mirror create myos/stable http://host-b/myos/stable bookworm main then everything is correct but this mirror does not contain installer-images
  4. If i create mirror like this: aptly mirror create -with-installer -with-udebs myos/stable http://host-b/myos/stable bookworm main then aptly tries to fetch "installer-all" folder structure (because i have "architectures": ["amd64", "all"] in my config) and fails to create a mirror
  5. I found a solution here: https://github.com/aptly-dev/aptly/issues/1144 and create a mirror like this: aptly mirror -keyring create -with-installer -with-udebs -architectures amd64 -filter='Name (~ installer)' myos/debian-installer/stable http://host-b/myos/stable bookworm main This works.
  6. However, when i try to publish all mirrors on the Host-A in one folder like this (from snapshots, i have main, contrib and non-free-firmware components):
    aptly publish snapshot -component=,, myos/stable/20230821 myos/contrib/stable/20230821 myos/non-free-firmware/stable/20230821 myos/stable
    aptly publish myos/debian-installer/stable/20230821  myos/stable

    i get a reasonable error "ERROR: prefix/distribution already used by another published repo"

So how can i mirror and publish the whole repository including debian-installer and installer-amd64 images? Or how to avoid searching for "installer-all" folder? There is no such installer, but there is such architecture in all distributions.

hiddenman commented 10 months ago

Just tried this combination:

aptly mirror -architectures="amd64" -with-installer -with-udebs create myos/stable http://host-b/myos/stable bookworm main and it was successful: main components were fetched for both architectures amd64 and all, but installer was fetched only for amd64 architecture.

This is a working solution but not documented. Could you please explain why this happens.

neolynx commented 2 months ago

The ERROR: prefix/distribution already used by another published repo is likely because of multiple tries, and some publish point with the same name already existed.

aptly does some magic when detecting and combining components, which usually works fine. Do I assume right the working solution is not to specify the -component=,, ?