aptly-dev / aptly

aptly - Debian repository management tool

Home Page:https://www.aptly.info/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need help to get these packages using aptly

lchunleo opened this issue · comments

i will need to get these
ubuntu:
linux-headers-${KERNEL_VERSION}
linux-image-${KERNEL_VERSION}
linux-modules-${KERNEL_VERSION}

but my current mirror create is:

a) aptly mirror create -architecture-amd64 -filter='linux-headers | linux-image | linux-modules' -with-sources ubuntu-linux http://archive.ubuntu.om/ubuntu focal main universe. This parse through but the outcome of the files are not what i need.

i had tried to put the kernel version to append : 5.x.x is fictious numbering

b) aptly mirror create -architecture-amd64 -filter='linux-headers-5.x.x | linux-image-5.x.x | linux-modules-5.x.x' -with-sources ubuntu-linux http://archive.ubuntu.om/ubuntu focal main universe but there is parsing errors.

I also if i tried step a and follow the way through to publish, i don't see any public folder in the .aptly .

any advise?

( Now this might feel rather embarassing, but I'm just here to help, and believe me, I've done worse; ) We can fix this:

  • archive.ubuntu.om is not a valid domain according to ICANN, as om is not a top-level domain - We probably want archive.ubuntu.com (Notice the additional c).
  • -architecture-amd64 is not a valid option, we probably want -architectures amd64
  • We can filter for all the packages you look for by using (% linux-*-5.4.0-26-generic), you want to change the filter for the kernel version you want and for the kernel type. I chose generic, which is used by default Ubuntu installations.
  • I can't see why we would need the universe component for this, just using main should suffice.
  • By the way, you may not like yourself at some point for having named the mirror "ubuntu-linux", might I suggest "ubuntu-focal-kernel"?

This seems to work for me:

# I extended this with newlines to increase readability

$ docker run --rm -it ubuntu:jammy bash

# In container

$ apt-get update
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:3 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [44.0 kB]
Get:4 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [979 kB]
Get:5 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [849 kB]
Get:6 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [834 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]           
Get:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:11 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [864 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1235 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1103 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [49.9 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [49.2 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [25.6 kB]
Fetched 8413 kB in 3s (3081 kB/s)                             
Reading package lists... Done

$ apt-get install --no-install-recommends --assume-yes aptly
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  bzip2 dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm
  libassuan0 libksba8 libldap-2.5-0 libnpth0 libreadline8 libsasl2-2 libsasl2-modules-db libsqlite3-0
  pinentry-curses readline-common xz-utils
Suggested packages:
  graphviz bzip2-doc dbus-user-session libpam-systemd pinentry-gnome3 tor parcimonie xloadimage scdaemon
  pinentry-doc readline-doc
Recommended packages:
  libldap-common libsasl2-modules
The following NEW packages will be installed:
  aptly bzip2 dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm
  libassuan0 libksba8 libldap-2.5-0 libnpth0 libreadline8 libsasl2-2 libsasl2-modules-db libsqlite3-0
  pinentry-curses readline-common xz-utils
0 upgraded, 23 newly installed, 0 to remove and 29 not upgraded.
Need to get 8442 kB of archives.
After this operation, 27.3 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 readline-common all 8.1.2-1 [53.5 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 libreadline8 amd64 8.1.2-1 [153 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libsqlite3-0 amd64 3.37.2-2ubuntu0.1 [641 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 xz-utils amd64 5.2.5-2ubuntu1 [84.8 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy/main amd64 bzip2 amd64 1.0.8-5build1 [34.8 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 libassuan0 amd64 2.5.5-1build1 [38.2 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpgconf amd64 2.2.27-3ubuntu2.1 [94.2 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libksba8 amd64 1.6.0-2ubuntu0.2 [119 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libsasl2-modules-db amd64 2.1.27+dfsg2-3ubuntu1.2 [20.5 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libsasl2-2 amd64 2.1.27+dfsg2-3ubuntu1.2 [53.8 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libldap-2.5-0 amd64 2.5.15+dfsg-0ubuntu0.22.04.1 [183 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 libnpth0 amd64 1.6-3build2 [8664 B]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 dirmngr amd64 2.2.27-3ubuntu2.1 [293 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gnupg-l10n all 2.2.27-3ubuntu2.1 [54.4 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gnupg-utils amd64 2.2.27-3ubuntu2.1 [308 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg amd64 2.2.27-3ubuntu2.1 [519 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy/main amd64 pinentry-curses amd64 1.1.1-1build2 [34.4 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg-agent amd64 2.2.27-3ubuntu2.1 [209 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg-wks-client amd64 2.2.27-3ubuntu2.1 [62.7 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg-wks-server amd64 2.2.27-3ubuntu2.1 [57.5 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpgsm amd64 2.2.27-3ubuntu2.1 [197 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gnupg all 2.2.27-3ubuntu2.1 [315 kB]
Get:23 http://archive.ubuntu.com/ubuntu jammy/universe amd64 aptly amd64 1.4.0+ds1-6 [4907 kB]
Fetched 8442 kB in 2s (4298 kB/s) 
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package readline-common.
(Reading database ... 4395 files and directories currently installed.)
Preparing to unpack .../00-readline-common_8.1.2-1_all.deb ...
Unpacking readline-common (8.1.2-1) ...
Selecting previously unselected package libreadline8:amd64.
Preparing to unpack .../01-libreadline8_8.1.2-1_amd64.deb ...
Unpacking libreadline8:amd64 (8.1.2-1) ...
Selecting previously unselected package libsqlite3-0:amd64.
Preparing to unpack .../02-libsqlite3-0_3.37.2-2ubuntu0.1_amd64.deb ...
Unpacking libsqlite3-0:amd64 (3.37.2-2ubuntu0.1) ...
Selecting previously unselected package xz-utils.
Preparing to unpack .../03-xz-utils_5.2.5-2ubuntu1_amd64.deb ...
Unpacking xz-utils (5.2.5-2ubuntu1) ...
Selecting previously unselected package bzip2.
Preparing to unpack .../04-bzip2_1.0.8-5build1_amd64.deb ...
Unpacking bzip2 (1.0.8-5build1) ...
Selecting previously unselected package libassuan0:amd64.
Preparing to unpack .../05-libassuan0_2.5.5-1build1_amd64.deb ...
Unpacking libassuan0:amd64 (2.5.5-1build1) ...
Selecting previously unselected package gpgconf.
Preparing to unpack .../06-gpgconf_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpgconf (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package libksba8:amd64.
Preparing to unpack .../07-libksba8_1.6.0-2ubuntu0.2_amd64.deb ...
Unpacking libksba8:amd64 (1.6.0-2ubuntu0.2) ...
Selecting previously unselected package libsasl2-modules-db:amd64.
Preparing to unpack .../08-libsasl2-modules-db_2.1.27+dfsg2-3ubuntu1.2_amd64.deb ...
Unpacking libsasl2-modules-db:amd64 (2.1.27+dfsg2-3ubuntu1.2) ...
Selecting previously unselected package libsasl2-2:amd64.
Preparing to unpack .../09-libsasl2-2_2.1.27+dfsg2-3ubuntu1.2_amd64.deb ...
Unpacking libsasl2-2:amd64 (2.1.27+dfsg2-3ubuntu1.2) ...
Selecting previously unselected package libldap-2.5-0:amd64.
Preparing to unpack .../10-libldap-2.5-0_2.5.15+dfsg-0ubuntu0.22.04.1_amd64.deb ...
Unpacking libldap-2.5-0:amd64 (2.5.15+dfsg-0ubuntu0.22.04.1) ...
Selecting previously unselected package libnpth0:amd64.
Preparing to unpack .../11-libnpth0_1.6-3build2_amd64.deb ...
Unpacking libnpth0:amd64 (1.6-3build2) ...
Selecting previously unselected package dirmngr.
Preparing to unpack .../12-dirmngr_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking dirmngr (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gnupg-l10n.
Preparing to unpack .../13-gnupg-l10n_2.2.27-3ubuntu2.1_all.deb ...
Unpacking gnupg-l10n (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gnupg-utils.
Preparing to unpack .../14-gnupg-utils_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gnupg-utils (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gpg.
Preparing to unpack .../15-gpg_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpg (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package pinentry-curses.
Preparing to unpack .../16-pinentry-curses_1.1.1-1build2_amd64.deb ...
Unpacking pinentry-curses (1.1.1-1build2) ...
Selecting previously unselected package gpg-agent.
Preparing to unpack .../17-gpg-agent_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpg-agent (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gpg-wks-client.
Preparing to unpack .../18-gpg-wks-client_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpg-wks-client (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gpg-wks-server.
Preparing to unpack .../19-gpg-wks-server_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpg-wks-server (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gpgsm.
Preparing to unpack .../20-gpgsm_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpgsm (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gnupg.
Preparing to unpack .../21-gnupg_2.2.27-3ubuntu2.1_all.deb ...
Unpacking gnupg (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package aptly.
Preparing to unpack .../22-aptly_1.4.0+ds1-6_amd64.deb ...
Unpacking aptly (1.4.0+ds1-6) ...
Setting up libksba8:amd64 (1.6.0-2ubuntu0.2) ...
Setting up libsqlite3-0:amd64 (3.37.2-2ubuntu0.1) ...
Setting up libnpth0:amd64 (1.6-3build2) ...
Setting up libassuan0:amd64 (2.5.5-1build1) ...
Setting up bzip2 (1.0.8-5build1) ...
Setting up libsasl2-modules-db:amd64 (2.1.27+dfsg2-3ubuntu1.2) ...
Setting up gnupg-l10n (2.2.27-3ubuntu2.1) ...
Setting up xz-utils (5.2.5-2ubuntu1) ...
update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/lzma.1.gz because associated file /usr/share/man/man1/xz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/unlzma.1.gz because associated file /usr/share/man/man1/unxz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcat.1.gz because associated file /usr/share/man/man1/xzcat.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzmore.1.gz because associated file /usr/share/man/man1/xzmore.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzless.1.gz because associated file /usr/share/man/man1/xzless.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzdiff.1.gz because associated file /usr/share/man/man1/xzdiff.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcmp.1.gz because associated file /usr/share/man/man1/xzcmp.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzgrep.1.gz because associated file /usr/share/man/man1/xzgrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzegrep.1.gz because associated file /usr/share/man/man1/xzegrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzfgrep.1.gz because associated file /usr/share/man/man1/xzfgrep.1.gz (of link group lzma) doesn't exist
Setting up libsasl2-2:amd64 (2.1.27+dfsg2-3ubuntu1.2) ...
Setting up readline-common (8.1.2-1) ...
Setting up pinentry-curses (1.1.1-1build2) ...
Setting up libreadline8:amd64 (8.1.2-1) ...
Setting up libldap-2.5-0:amd64 (2.5.15+dfsg-0ubuntu0.22.04.1) ...
Setting up gpgconf (2.2.27-3ubuntu2.1) ...
Setting up gpg (2.2.27-3ubuntu2.1) ...
Setting up gnupg-utils (2.2.27-3ubuntu2.1) ...
Setting up gpg-agent (2.2.27-3ubuntu2.1) ...
Setting up gpgsm (2.2.27-3ubuntu2.1) ...
Setting up dirmngr (2.2.27-3ubuntu2.1) ...
Setting up gpg-wks-server (2.2.27-3ubuntu2.1) ...
Setting up gpg-wks-client (2.2.27-3ubuntu2.1) ...
Setting up gnupg (2.2.27-3ubuntu2.1) ...
Setting up aptly (1.4.0+ds1-6) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...

$ adduser --disabled-password --gecos "" aptly
Adding user `aptly' ...
Adding new group `aptly' (1000) ...
Adding new user `aptly' (1000) with group `aptly' ...
Creating home directory `/home/aptly' ...
Copying files from `/etc/skel' ...

$ su - aptly

# We'll need some keys - I recommend to only import the keys you need, what we do here feels wrong
$ gpg --no-default-keyring --keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg --export | gpg --no-default-keyring --keyring trustedkeys.gpg --import
gpg: directory '/home/aptly/.gnupg' created
gpg: keybox '/home/aptly/.gnupg/trustedkeys.gpg' created
gpg: key 3B4FE6ACC0B21F32: 3 signatures not checked due to missing keys
gpg: /home/aptly/.gnupg/trustdb.gpg: trustdb created
gpg: key 3B4FE6ACC0B21F32: public key "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>" imported
gpg: key D94AA3F0EFE21092: 3 signatures not checked due to missing keys
gpg: key D94AA3F0EFE21092: public key "Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>" imported
gpg: key 871920D1991BC93C: 1 signature not checked due to a missing key
gpg: key 871920D1991BC93C: public key "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>" imported
gpg: Total number processed: 3
gpg:               imported: 3
gpg: no ultimately trusted keys found


# Override mirrored kernel version here
$ KERNEL_VERSION=5.4.0
# Override mirrored kernel flavor here
$ KERNEL_FLAVOR=generic

$ aptly mirror create -architectures amd64 -with-sources -filter="Name (% linux-*-${KERNEL_VERSION}-*-${KERNEL_FLAVOR})"  ubuntu-focal-kernel http://archive.ubuntu.com/ubuntu focal main
Config file not found, creating default config at /home/aptly/.aptly.conf

Downloading http://archive.ubuntu.com/ubuntu/dists/focal/InRelease...
gpgv: can't allocate lock for '/home/aptly/.gnupg/trustedkeys.gpg'
gpgv: Signature made Thu Apr 23 17:34:17 2020 UTC
gpgv:                using RSA key 3B4FE6ACC0B21F32
gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>"
gpgv: Signature made Thu Apr 23 17:34:17 2020 UTC
gpgv:                using RSA key 871920D1991BC93C
gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>"

Mirror [ubuntu-focal-kernel]: http://archive.ubuntu.com/ubuntu/ focal [src] successfully added.
You can run 'aptly mirror update ubuntu-focal-kernel' to download repository contents.

$ aptly mirror update ubuntu-focal-kernel
Downloading http://archive.ubuntu.com/ubuntu/dists/focal/InRelease...
gpgv: can't allocate lock for '/home/aptly/.gnupg/trustedkeys.gpg'
gpgv: Signature made Thu Apr 23 17:34:17 2020 UTC
gpgv:                using RSA key 3B4FE6ACC0B21F32
gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>"
gpgv: Signature made Thu Apr 23 17:34:17 2020 UTC
gpgv:                using RSA key 871920D1991BC93C
gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>"
Downloading & parsing package files...
Downloading http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-amd64/Packages.gz...
Downloading http://archive.ubuntu.com/ubuntu/dists/focal/main/source/Sources.gz...
Applying filter...
Packages filtered: 8461 -> 8.
Building download queue...
Download queue: 8 items (68.82 MiB)
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-tools-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux-signed/linux-image-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-modules-extra-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-image-unsigned-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-buildinfo-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-modules-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-cloud-tools-5.4.0-26-generic_5.4.0-26.30_amd64.deb...

Mirror `ubuntu-focal-kernel` has been successfully updated.

Closing, as this doesn't seem to be an issue with aptly itself. Thanks @r4co0n for your help 👏. It is much appreciated.

( Now this might feel rather embarassing, but I'm just here to help, and believe me, I've done worse; ) We can fix this:

  • archive.ubuntu.om is not a valid domain according to ICANN, as om is not a top-level domain - We probably want archive.ubuntu.com (Notice the additional c).
  • -architecture-amd64 is not a valid option, we probably want -architectures amd64
  • We can filter for all the packages you look for by using (% linux-*-5.4.0-26-generic), you want to change the filter for the kernel version you want and for the kernel type. I chose generic, which is used by default Ubuntu installations.
  • I can't see why we would need the universe component for this, just using main should suffice.
  • By the way, you may not like yourself at some point for having named the mirror "ubuntu-linux", might I suggest "ubuntu-focal-kernel"?

This seems to work for me:

# I extended this with newlines to increase readability

$ docker run --rm -it ubuntu:jammy bash

# In container

$ apt-get update
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:3 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [44.0 kB]
Get:4 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [979 kB]
Get:5 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [849 kB]
Get:6 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [834 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]           
Get:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:11 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [864 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1235 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1103 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [49.9 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [49.2 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [25.6 kB]
Fetched 8413 kB in 3s (3081 kB/s)                             
Reading package lists... Done

$ apt-get install --no-install-recommends --assume-yes aptly
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  bzip2 dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm
  libassuan0 libksba8 libldap-2.5-0 libnpth0 libreadline8 libsasl2-2 libsasl2-modules-db libsqlite3-0
  pinentry-curses readline-common xz-utils
Suggested packages:
  graphviz bzip2-doc dbus-user-session libpam-systemd pinentry-gnome3 tor parcimonie xloadimage scdaemon
  pinentry-doc readline-doc
Recommended packages:
  libldap-common libsasl2-modules
The following NEW packages will be installed:
  aptly bzip2 dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm
  libassuan0 libksba8 libldap-2.5-0 libnpth0 libreadline8 libsasl2-2 libsasl2-modules-db libsqlite3-0
  pinentry-curses readline-common xz-utils
0 upgraded, 23 newly installed, 0 to remove and 29 not upgraded.
Need to get 8442 kB of archives.
After this operation, 27.3 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 readline-common all 8.1.2-1 [53.5 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 libreadline8 amd64 8.1.2-1 [153 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libsqlite3-0 amd64 3.37.2-2ubuntu0.1 [641 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 xz-utils amd64 5.2.5-2ubuntu1 [84.8 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy/main amd64 bzip2 amd64 1.0.8-5build1 [34.8 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 libassuan0 amd64 2.5.5-1build1 [38.2 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpgconf amd64 2.2.27-3ubuntu2.1 [94.2 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libksba8 amd64 1.6.0-2ubuntu0.2 [119 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libsasl2-modules-db amd64 2.1.27+dfsg2-3ubuntu1.2 [20.5 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libsasl2-2 amd64 2.1.27+dfsg2-3ubuntu1.2 [53.8 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libldap-2.5-0 amd64 2.5.15+dfsg-0ubuntu0.22.04.1 [183 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 libnpth0 amd64 1.6-3build2 [8664 B]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 dirmngr amd64 2.2.27-3ubuntu2.1 [293 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gnupg-l10n all 2.2.27-3ubuntu2.1 [54.4 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gnupg-utils amd64 2.2.27-3ubuntu2.1 [308 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg amd64 2.2.27-3ubuntu2.1 [519 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy/main amd64 pinentry-curses amd64 1.1.1-1build2 [34.4 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg-agent amd64 2.2.27-3ubuntu2.1 [209 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg-wks-client amd64 2.2.27-3ubuntu2.1 [62.7 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpg-wks-server amd64 2.2.27-3ubuntu2.1 [57.5 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gpgsm amd64 2.2.27-3ubuntu2.1 [197 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gnupg all 2.2.27-3ubuntu2.1 [315 kB]
Get:23 http://archive.ubuntu.com/ubuntu jammy/universe amd64 aptly amd64 1.4.0+ds1-6 [4907 kB]
Fetched 8442 kB in 2s (4298 kB/s) 
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package readline-common.
(Reading database ... 4395 files and directories currently installed.)
Preparing to unpack .../00-readline-common_8.1.2-1_all.deb ...
Unpacking readline-common (8.1.2-1) ...
Selecting previously unselected package libreadline8:amd64.
Preparing to unpack .../01-libreadline8_8.1.2-1_amd64.deb ...
Unpacking libreadline8:amd64 (8.1.2-1) ...
Selecting previously unselected package libsqlite3-0:amd64.
Preparing to unpack .../02-libsqlite3-0_3.37.2-2ubuntu0.1_amd64.deb ...
Unpacking libsqlite3-0:amd64 (3.37.2-2ubuntu0.1) ...
Selecting previously unselected package xz-utils.
Preparing to unpack .../03-xz-utils_5.2.5-2ubuntu1_amd64.deb ...
Unpacking xz-utils (5.2.5-2ubuntu1) ...
Selecting previously unselected package bzip2.
Preparing to unpack .../04-bzip2_1.0.8-5build1_amd64.deb ...
Unpacking bzip2 (1.0.8-5build1) ...
Selecting previously unselected package libassuan0:amd64.
Preparing to unpack .../05-libassuan0_2.5.5-1build1_amd64.deb ...
Unpacking libassuan0:amd64 (2.5.5-1build1) ...
Selecting previously unselected package gpgconf.
Preparing to unpack .../06-gpgconf_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpgconf (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package libksba8:amd64.
Preparing to unpack .../07-libksba8_1.6.0-2ubuntu0.2_amd64.deb ...
Unpacking libksba8:amd64 (1.6.0-2ubuntu0.2) ...
Selecting previously unselected package libsasl2-modules-db:amd64.
Preparing to unpack .../08-libsasl2-modules-db_2.1.27+dfsg2-3ubuntu1.2_amd64.deb ...
Unpacking libsasl2-modules-db:amd64 (2.1.27+dfsg2-3ubuntu1.2) ...
Selecting previously unselected package libsasl2-2:amd64.
Preparing to unpack .../09-libsasl2-2_2.1.27+dfsg2-3ubuntu1.2_amd64.deb ...
Unpacking libsasl2-2:amd64 (2.1.27+dfsg2-3ubuntu1.2) ...
Selecting previously unselected package libldap-2.5-0:amd64.
Preparing to unpack .../10-libldap-2.5-0_2.5.15+dfsg-0ubuntu0.22.04.1_amd64.deb ...
Unpacking libldap-2.5-0:amd64 (2.5.15+dfsg-0ubuntu0.22.04.1) ...
Selecting previously unselected package libnpth0:amd64.
Preparing to unpack .../11-libnpth0_1.6-3build2_amd64.deb ...
Unpacking libnpth0:amd64 (1.6-3build2) ...
Selecting previously unselected package dirmngr.
Preparing to unpack .../12-dirmngr_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking dirmngr (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gnupg-l10n.
Preparing to unpack .../13-gnupg-l10n_2.2.27-3ubuntu2.1_all.deb ...
Unpacking gnupg-l10n (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gnupg-utils.
Preparing to unpack .../14-gnupg-utils_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gnupg-utils (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gpg.
Preparing to unpack .../15-gpg_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpg (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package pinentry-curses.
Preparing to unpack .../16-pinentry-curses_1.1.1-1build2_amd64.deb ...
Unpacking pinentry-curses (1.1.1-1build2) ...
Selecting previously unselected package gpg-agent.
Preparing to unpack .../17-gpg-agent_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpg-agent (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gpg-wks-client.
Preparing to unpack .../18-gpg-wks-client_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpg-wks-client (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gpg-wks-server.
Preparing to unpack .../19-gpg-wks-server_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpg-wks-server (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gpgsm.
Preparing to unpack .../20-gpgsm_2.2.27-3ubuntu2.1_amd64.deb ...
Unpacking gpgsm (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package gnupg.
Preparing to unpack .../21-gnupg_2.2.27-3ubuntu2.1_all.deb ...
Unpacking gnupg (2.2.27-3ubuntu2.1) ...
Selecting previously unselected package aptly.
Preparing to unpack .../22-aptly_1.4.0+ds1-6_amd64.deb ...
Unpacking aptly (1.4.0+ds1-6) ...
Setting up libksba8:amd64 (1.6.0-2ubuntu0.2) ...
Setting up libsqlite3-0:amd64 (3.37.2-2ubuntu0.1) ...
Setting up libnpth0:amd64 (1.6-3build2) ...
Setting up libassuan0:amd64 (2.5.5-1build1) ...
Setting up bzip2 (1.0.8-5build1) ...
Setting up libsasl2-modules-db:amd64 (2.1.27+dfsg2-3ubuntu1.2) ...
Setting up gnupg-l10n (2.2.27-3ubuntu2.1) ...
Setting up xz-utils (5.2.5-2ubuntu1) ...
update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/lzma.1.gz because associated file /usr/share/man/man1/xz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/unlzma.1.gz because associated file /usr/share/man/man1/unxz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcat.1.gz because associated file /usr/share/man/man1/xzcat.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzmore.1.gz because associated file /usr/share/man/man1/xzmore.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzless.1.gz because associated file /usr/share/man/man1/xzless.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzdiff.1.gz because associated file /usr/share/man/man1/xzdiff.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcmp.1.gz because associated file /usr/share/man/man1/xzcmp.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzgrep.1.gz because associated file /usr/share/man/man1/xzgrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzegrep.1.gz because associated file /usr/share/man/man1/xzegrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzfgrep.1.gz because associated file /usr/share/man/man1/xzfgrep.1.gz (of link group lzma) doesn't exist
Setting up libsasl2-2:amd64 (2.1.27+dfsg2-3ubuntu1.2) ...
Setting up readline-common (8.1.2-1) ...
Setting up pinentry-curses (1.1.1-1build2) ...
Setting up libreadline8:amd64 (8.1.2-1) ...
Setting up libldap-2.5-0:amd64 (2.5.15+dfsg-0ubuntu0.22.04.1) ...
Setting up gpgconf (2.2.27-3ubuntu2.1) ...
Setting up gpg (2.2.27-3ubuntu2.1) ...
Setting up gnupg-utils (2.2.27-3ubuntu2.1) ...
Setting up gpg-agent (2.2.27-3ubuntu2.1) ...
Setting up gpgsm (2.2.27-3ubuntu2.1) ...
Setting up dirmngr (2.2.27-3ubuntu2.1) ...
Setting up gpg-wks-server (2.2.27-3ubuntu2.1) ...
Setting up gpg-wks-client (2.2.27-3ubuntu2.1) ...
Setting up gnupg (2.2.27-3ubuntu2.1) ...
Setting up aptly (1.4.0+ds1-6) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...

$ adduser --disabled-password --gecos "" aptly
Adding user `aptly' ...
Adding new group `aptly' (1000) ...
Adding new user `aptly' (1000) with group `aptly' ...
Creating home directory `/home/aptly' ...
Copying files from `/etc/skel' ...

$ su - aptly

# We'll need some keys - I recommend to only import the keys you need, what we do here feels wrong
$ gpg --no-default-keyring --keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg --export | gpg --no-default-keyring --keyring trustedkeys.gpg --import
gpg: directory '/home/aptly/.gnupg' created
gpg: keybox '/home/aptly/.gnupg/trustedkeys.gpg' created
gpg: key 3B4FE6ACC0B21F32: 3 signatures not checked due to missing keys
gpg: /home/aptly/.gnupg/trustdb.gpg: trustdb created
gpg: key 3B4FE6ACC0B21F32: public key "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>" imported
gpg: key D94AA3F0EFE21092: 3 signatures not checked due to missing keys
gpg: key D94AA3F0EFE21092: public key "Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>" imported
gpg: key 871920D1991BC93C: 1 signature not checked due to a missing key
gpg: key 871920D1991BC93C: public key "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>" imported
gpg: Total number processed: 3
gpg:               imported: 3
gpg: no ultimately trusted keys found


# Override mirrored kernel version here
$ KERNEL_VERSION=5.4.0
# Override mirrored kernel flavor here
$ KERNEL_FLAVOR=generic

$ aptly mirror create -architectures amd64 -with-sources -filter="Name (% linux-*-${KERNEL_VERSION}-*-${KERNEL_FLAVOR})"  ubuntu-focal-kernel http://archive.ubuntu.com/ubuntu focal main
Config file not found, creating default config at /home/aptly/.aptly.conf

Downloading http://archive.ubuntu.com/ubuntu/dists/focal/InRelease...
gpgv: can't allocate lock for '/home/aptly/.gnupg/trustedkeys.gpg'
gpgv: Signature made Thu Apr 23 17:34:17 2020 UTC
gpgv:                using RSA key 3B4FE6ACC0B21F32
gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>"
gpgv: Signature made Thu Apr 23 17:34:17 2020 UTC
gpgv:                using RSA key 871920D1991BC93C
gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>"

Mirror [ubuntu-focal-kernel]: http://archive.ubuntu.com/ubuntu/ focal [src] successfully added.
You can run 'aptly mirror update ubuntu-focal-kernel' to download repository contents.

$ aptly mirror update ubuntu-focal-kernel
Downloading http://archive.ubuntu.com/ubuntu/dists/focal/InRelease...
gpgv: can't allocate lock for '/home/aptly/.gnupg/trustedkeys.gpg'
gpgv: Signature made Thu Apr 23 17:34:17 2020 UTC
gpgv:                using RSA key 3B4FE6ACC0B21F32
gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>"
gpgv: Signature made Thu Apr 23 17:34:17 2020 UTC
gpgv:                using RSA key 871920D1991BC93C
gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>"
Downloading & parsing package files...
Downloading http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-amd64/Packages.gz...
Downloading http://archive.ubuntu.com/ubuntu/dists/focal/main/source/Sources.gz...
Applying filter...
Packages filtered: 8461 -> 8.
Building download queue...
Download queue: 8 items (68.82 MiB)
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-tools-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux-signed/linux-image-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-modules-extra-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-image-unsigned-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-buildinfo-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-modules-5.4.0-26-generic_5.4.0-26.30_amd64.deb...
Downloading http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-cloud-tools-5.4.0-26-generic_5.4.0-26.30_amd64.deb...

Mirror `ubuntu-focal-kernel` has been successfully updated.

Thank you for your help to check it out :)