From bf894162a63d65e414f5076bbc39e65c5207edf1 Mon Sep 17 00:00:00 2001 From: Rui Lopes Date: Wed, 11 Jun 2025 08:14:20 +0100 Subject: [PATCH] configure the apt-hosted repository to use the apt-hosted key --- provision/use-apt-repository.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/provision/use-apt-repository.sh b/provision/use-apt-repository.sh index 4b9ffce..6a632b3 100644 --- a/provision/use-apt-repository.sh +++ b/provision/use-apt-repository.sh @@ -30,11 +30,12 @@ curl \ --data-binary @hello-world_1.0.0_amd64.deb \ https://$nexus_domain/repository/apt-hosted/ -# trust the apt-hosted key. -apt-key add /vagrant/shared/apt-hosted-public.key +# import the apt-hosted key. +nexus_apt_hosted_keyring_path="/etc/apt/keyrings/$nexus_domain-apt-hosted.gpg" +gpg --dearmor -o "$nexus_apt_hosted_keyring_path" /etc/apt/sources.list.d/nexus-apt-hosted.list +echo "deb [arch=amd64 signed-by=$nexus_apt_hosted_keyring_path] https://$nexus_domain/repository/apt-hosted jammy main" >"/etc/apt/sources.list.d/$nexus_domain-apt-hosted.list" apt-get update apt-get install -y hello-world apt-cache show hello-world