Can I create a new "suite" in aptly?

29 views
Skip to first unread message

alan amaral

unread,
Jan 25, 2024, 4:55:54 PMJan 25
to aptly-discuss

I'm an aptly noob, and I've inherited the maintenance of an aptly installation that was setup with 3 repos "XXX-main", "XXX-staging", and "XXX-test". There is a subdirectory XXX/public/XXX/dists/bionic under the top-level aptly directory. In our remote machines our apt sources .list file the "suite" is "bionic", and the component is one of "main", "staging" or "test". "bionic" is Ubuntu 18.04, which is the distro that the machines we have in the field are running.

There is a subdirectory XXX/public/XXX/dists/bionic under the top-level aptly directory.

We are in the process of updating our systems in the field to 22.04 (jammy), and we have new versions of the packages specifically built for 22.04 that we would like to keep separate from the 18.04 versions, just like Ubuntu does with its stuff, i.e. by changing the "suite" from "bionic" to "jammy" in our apt XXX.list files on the remote machines. I'm assuming I need to do something to create an XXX/public/XXX/dists/jammy tree. I tried creating it by hand, copying some of the files from the bionic tree, as was suggested in a posting I found elsewhere, but I couldn't figure out how to get the Contents-amd64.gz file created.

Is there a way I can do this, given how my aptly is currently setup? I can't figure out what commands to use to just add jammy to the repos, or is that even possible?

Todd Goodman

unread,
Jan 26, 2024, 4:53:28 PMJan 26
to aptly-...@googlegroups.com

Hi Alan,

If I'm understanding your existing setup, I would do the following:

  1. Create repos for the jammy versions of your existing repos (there are options you can use with these commands, see https://www.aptly.info/doc/aptly/repo/create/ to decide if you want to use any):
    • aptly repo create XXX-jammy-main
    • aptly repo create XXX-jammy-staging
    • aptly repo create XXX-jammy-test
  2. Add packages to these repos using 'aptly repo add <reponame, e.g., XXX-jammy-main> <list of packages here>'
  3. Create snapshots of these repos (we always use snapshots and don't publish repos directly) using 'aptly snapshot create <snapshot name, e.g., XXX-jammy-main-20240126164300> from repo <repo name, e.g., XXX-jammy-main>
  4. Now publish these snapshots (which will create all the needed files under XXX/public/XXX for the new distribution, jammy) with 'aptly publish snapshot -component=main,staging,test -distribution jammy <list of snapshots created in step 3, e.g., XXX-jammy-main-20240126164300 XXX-jammy-staging-20240126164300 XXX-jammy-test-20240126164300> XXX

The last XXX in step four is the XXX in your subdirectory below between "public" and "dists" without any path separators

You said repos, but if you meant mirrors then you'd do mirror creates and mirror updates first in step #1, not do step #2 and in step #3 use aptly snapshot create ... from mirror.  See under https://www.aptly.info/doc/aptly/mirror/

Best regards,

Todd

--
You received this message because you are subscribed to the Google Groups "aptly-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aptly-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aptly-discuss/a3f08e62-0588-4a59-a2b3-0734a224b910n%40googlegroups.com.

alan amaral

unread,
Feb 2, 2024, 1:10:22 PMFeb 2
to aptly-discuss
Thanks for the help.  I tried all that, and it worked...   You're a lifesaver.  

I've been able to create the repos, create the snapshots, publish them, and do an apt update on my remote machine.
Now, if I want to add new packages to one or more of my new repos  what do I have to do?
I tried generating new snapshots and publishing them, but I get the following error:

ERROR: prefix/distribution already used by another published repo: ./jammy [amd64] publishes {main: [XXX-jammy-test3.snap]: Snapshot from local repo [XXX-jammy-test]: Test 22.04 build software}, {staging: [XXX-jammy-staging3.snap]: Snapshot from local repo [XXX-jammy-staging]: Software 22.04 built on staging}, {test: [XXX-jammy-main3.snap]: Snapshot from local repo [XXX-jammy-main]: Production 22.04 build software}

Alan

alan amaral

unread,
Feb 2, 2024, 1:12:38 PMFeb 2
to aptly-discuss
BTW, these aptly repos are to make our custom software available to our remote Ubuntu machines, they're not mirroring another repo.

Todd Goodman

unread,
Feb 3, 2024, 9:15:53 AMFeb 3
to aptly-...@googlegroups.com

I'm glad it's working for you.

You should be able to use the aptly publish switch (https://www.aptly.info/doc/aptly/publish/switch/) command to switch the published snapshot.

However, we've had issues in the past with it (almost certainly due to us not understanding how to use it correctly) so we just do an 'aptly publish drop <distribution> <prefix>' before we publish when we want to republish.

That works for us because we can support having the repo down for the time that takes.

It would be much better to use the switch to eliminate the time when the repo's not available.

In your case I think the aptly publish switch command would be:

aptly publish switch -component=main,staging,test jammy XXX <list of snapshots created in step 3, e.g., XXX-jammy-main-20240126164300 XXX-jammy-staging-20240126164300 XXX-jammy-test-20240126164300>

where XXX is the prefix you're publishing at again.

If you want to go the route of dropping the publication first then something like:

aptly publish drop jammy XXX && aptly publish snapshot -component=main,staging,test -distribution jammy <list of new snapshots, e.g., XXX-jammy-main-20240203091400 XXX-jammy-staging-20240203091400 XXX-jammy-test-20240203091400> XXX

Todd

Reply all
Reply to author
Forward
0 new messages