configure the apt-hosted repository to use the apt-hosted key

This commit is contained in:
Rui Lopes 2025-06-11 08:14:20 +01:00
parent 8ac67e7ac5
commit bf894162a6
No known key found for this signature in database
1 changed files with 4 additions and 3 deletions

View File

@ -30,11 +30,12 @@ curl \
--data-binary @hello-world_1.0.0_amd64.deb \ --data-binary @hello-world_1.0.0_amd64.deb \
https://$nexus_domain/repository/apt-hosted/ https://$nexus_domain/repository/apt-hosted/
# trust the apt-hosted key. # import the apt-hosted key.
apt-key add /vagrant/shared/apt-hosted-public.key nexus_apt_hosted_keyring_path="/etc/apt/keyrings/$nexus_domain-apt-hosted.gpg"
gpg --dearmor -o "$nexus_apt_hosted_keyring_path" </vagrant/shared/apt-hosted-public.key
# install the hello-world package. # install the hello-world package.
echo "deb [arch=amd64] https://$nexus_domain/repository/apt-hosted jammy main" >/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 update
apt-get install -y hello-world apt-get install -y hello-world
apt-cache show hello-world apt-cache show hello-world