How to mirror and manage repositories with the API

Give this a try. First, download the gpg key.

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub

Then import the key into Landscape

landscape-api import-gpg-key nvidia-cuda 3bf863cc.pub

Next, create the distribution. Note: If you want to mirror other releases 18.04/22.04 make sure to make these separate distributions as well, otherwise the filenames may overlap within the mirror’s directory structure and result in errors about checksums not matching.

landscape-api create-distribution nvidia-cuda-focal

Then create the series, and the release pocket. This is admittedly a bit different than the standard instructions, because nVidia have a flat structure to their repo, and they name things differently.

landscape-api create-series \
--pockets release \
--components main \
--architectures amd64 \
--gpg-key <mirror-key> \
--mirror-gpg-key nvidia-cuda \
--mirror-uri https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ \
--mirror-series / \
focal nvidia-cuda-focal

Sync the pocket to pull in the packages

landscape-api sync-mirror-pocket release focal nvidia-cuda-focal

Monitor the sync process

watch 'landscape-api get-activities --query type:SyncPocketRequest --limit 1'
1 Like