aptly mirror: ERROR: unable to update: no candidates for debian-installer/binary-amd64/Packages found

Author:

Always check the source what supports when trying to mirror! We have lost some time before discovering that our source repository does not support udeb and source packages! If you create a mirror with “-with-sources=true -with-udebs=true” the update process will require files, which may not exists in the source repository if it does not offer udeb or source files and you’ll end up with broken mirror and error for missing file!

Downloading & parsing package files...
Downloading http://aptly.example.com/ubuntu/dists/xenial-myrepos/main/binary-amd64/Packages.bz2...
ERROR: unable to update: no candidates for http://aptly-master.example.com/ubuntu/dists/xenial-myrepo/main/debian-installer/binary-amd64/Packages found

If you get error for “debian-installer/binary-amd64/Packages” not found, check the source repository if it offers udeb and/or source packages – probably not, so drop your mirror and recreate it including one or the two options

-with-sources=false -with-udebs=false

Real world example

First, we created the mirror repository:

root@aptly-mirror ~ # aptly mirror create -architectures=amd64 -with-sources=true -with-udebs=true xenial-myrepo http://aptly-master.example.com/ubuntu xenial-myrepo
Downloading http://aptly-master.example.com/ubuntu/dists/xenial-myrepo/InRelease...
gpgv: Signature made Fri 05 Jul 2019 04:19:17 AM UTC using DSA key ID FDC4A24A
gpgv: Good signature from "MyRepo (aptly key no passphrase) <myrepo@example.com>"

Mirror [xenial-myrepo]: http://aptly-master.example.com/ubuntu/ xenial-myrepo [src] [udeb] successfully added.
You can run 'aptly mirror update xenial-myrepo' to download repository contents.

Second, trying to update (on first update it will bring all files):

root@aptly-mirror ~ # aptly mirror update xenial-myrepo
Downloading http://aptly-master.example.com/ubuntu/dists/xenial-myrepo/InRelease...
gpgv: Signature made Fri 05 Jul 2019 04:19:17 AM UTC using DSA key ID FDC4A24A
gpgv: Good signature from "MyRepo (aptly key no passphrase) <myrepo@example.com>"
Downloading & parsing package files...
Downloading http://aptly-master.example.com/ubuntu/dists/xenial-myrepo/main/binary-amd64/Packages.bz2...
ERROR: unable to update: no candidates for http://aptly-master.example.com/ubuntu/dists/xenial-myrepo/main/debian-installer/binary-amd64/Packages found

And the error occurred! Some required files are not found!

The problem was we first must check what supports the source repository in xenial-myrepo http://aptly-master.example.com/ubuntu and then to create it in the aptly mirror server. First, we added a drop command to drop out the badly created mirror (probably if you reading this article you may need this drop 😉 ).
First, check the source server with:

root@aptly-master # aptly publish list|grep xenial-myrepo
  * ubuntu/xenial-myrepo [amd64] publishes {main: [xenial-myrepo-snapshot-1245]: Snapshot from local repo [xenial-myrepo]}

As you can see no udeb and sources are supported and the architeture is only amd64.
*Optional, in the mirror server drop the wrongly created mirror if it exists:

root@aptly-mirror ~ # aptly mirror drop xenial-myrepo
Mirror `xenial-myrepo` has been removed.

Second, create with the right parameters and update the mirror with:

root@aptly-mirror ~ # aptly mirror create -architectures=amd64 -with-sources=false -with-udebs=false xenial-myrepo http://aptly-master.example.com/ubuntu/ xenial-myrepo
Downloading http://aptly-master.example.com/ubuntu/dists/xenial-myrepo/InRelease...
gpgv: Signature made Fri 05 Jul 2019 04:19:17 AM UTC using DSA key ID FDC4A24A
gpgv: Good signature from "MyRepo (aptly key no passphrase) <myrepo@example.com>"

Mirror [xenial-myrepo]: http://aptly-master.example.com/ubuntu/ xenial-myrepo successfully added.
You can run 'aptly mirror update xenial-myrepo' to download repository contents.
root@aptly-mirror ~ # aptly mirror list | grep myrepo
 * [xenial-myrepo]: http://aptly-master.example.com/ubuntu/ xenial-myrepo
root@aptly-mirror ~ # aptly mirror update xenial-myrepo
Downloading http://aptly-master.example.com/ubuntu/dists/xenial-myrepo/InRelease...
gpgv: Signature made Fri 05 Jul 2019 04:19:17 AM UTC using DSA key ID FDC4A24A
gpgv: Good signature from "MyRepo (aptly key no passphrase) <myrepo@example.com>"
Downloading & parsing package files...
Downloading http://aptly-master.example.com/ubuntu/dists/xenial-myrepo/main/binary-amd64/Packages.bz2...
Building download queue...
Download queue: 4351 items (7.60 GiB)
Downloading http://aptly-master.example.com/ubuntu/pool/main/c/mypackage1-test/mypackage1-test-1.01.121.deb...
....

Mirror `xenial-myrepo` has been successfully updated.

Leave a Reply

Your email address will not be published. Required fields are marked *