From 8010455501e8d03745c5d120aa6a17912960469f Mon Sep 17 00:00:00 2001 From: Rui Lopes Date: Sat, 3 Dec 2022 11:10:03 +0000 Subject: [PATCH] upgrade to ubuntu 22.04 --- README.md | 2 +- Vagrantfile | 2 +- .../hello-world/debian/changelog | 2 +- provision/provision-dotnet-sdk.sh | 11 +++++++++++ .../provision-nexus/src/main/groovy/provision.groovy | 2 +- provision/use-apt-repository.sh | 2 +- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 22dc97f..6ebbdd9 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ This will: # Usage -Build and install the [Ubuntu 20.04 Base Box](https://github.com/rgl/ubuntu-vagrant). +Build and install the [Ubuntu 22.04 Base Box](https://github.com/rgl/ubuntu-vagrant). Build and install the [Windows 2022 Base Box](https://github.com/rgl/windows-vagrant). diff --git a/Vagrantfile b/Vagrantfile index 9213a87..4e50952 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -21,7 +21,7 @@ Vagrant.configure(2) do |config| end config.vm.define :nexus do |config| - config.vm.box = 'ubuntu-20.04-amd64' + config.vm.box = 'ubuntu-22.04-amd64' config.vm.hostname = nexus_domain config.vm.network 'private_network', ip: nexus_ip config.vm.provider :libvirt do |lv, config| diff --git a/hello-world-debian-package/hello-world/debian/changelog b/hello-world-debian-package/hello-world/debian/changelog index c2b69d7..114cd32 100644 --- a/hello-world-debian-package/hello-world/debian/changelog +++ b/hello-world-debian-package/hello-world/debian/changelog @@ -1,4 +1,4 @@ -hello-world (1.0.0) focal; urgency=low +hello-world (1.0.0) jammy; urgency=low * Hello World. diff --git a/provision/provision-dotnet-sdk.sh b/provision/provision-dotnet-sdk.sh index a3f8979..9f395e0 100644 --- a/provision/provision-dotnet-sdk.sh +++ b/provision/provision-dotnet-sdk.sh @@ -1,6 +1,17 @@ #!/bin/bash set -euxo pipefail +# pin the microsoft apt repository above the distro. +# see apt-cache policy +# see apt-cache policy dotnet-sdk-6.0 +# see apt-cache showpkg dotnet-sdk-6.0 +# see http://manpages.ubuntu.com/manpages/jammy/en/man5/apt_preferences.5.html +cat >/etc/apt/preferences.d/packages.microsoft.com.pref <<'EOF' +Package: * +Pin: origin "packages.microsoft.com" +Pin-Priority: 999 +EOF + # opt-out of telemetry. echo 'export DOTNET_CLI_TELEMETRY_OPTOUT=1' >/etc/profile.d/opt-out-dotnet-cli-telemetry.sh source /etc/profile.d/opt-out-dotnet-cli-telemetry.sh diff --git a/provision/provision-nexus/src/main/groovy/provision.groovy b/provision/provision-nexus/src/main/groovy/provision.groovy index d50f4cd..23c480d 100644 --- a/provision/provision-nexus/src/main/groovy/provision.groovy +++ b/provision/provision-nexus/src/main/groovy/provision.groovy @@ -36,7 +36,7 @@ repository.createRawHosted("adhoc-package", "default", false, WritePolicy.ALLOW_ // create a apt repository backed by the default blob store. // see https://help.sonatype.com/repomanager3/formats/apt-repositories pgpPrivateKey = new File('/vagrant/shared/apt-hosted-private.key').getText('UTF-8') -repository.createAptHosted("apt-hosted", "focal", pgpPrivateKey, "abracadabra", "default", WritePolicy.ALLOW_ONCE, true) +repository.createAptHosted("apt-hosted", "jammy", pgpPrivateKey, "abracadabra", "default", WritePolicy.ALLOW_ONCE, true) // create a npm repository backed by the default blob store. diff --git a/provision/use-apt-repository.sh b/provision/use-apt-repository.sh index 31a7d6f..4b9ffce 100644 --- a/provision/use-apt-repository.sh +++ b/provision/use-apt-repository.sh @@ -34,7 +34,7 @@ curl \ apt-key add /vagrant/shared/apt-hosted-public.key # install the hello-world package. -echo "deb [arch=amd64] https://$nexus_domain/repository/apt-hosted focal main" >/etc/apt/sources.list.d/nexus-apt-hosted.list +echo "deb [arch=amd64] https://$nexus_domain/repository/apt-hosted jammy main" >/etc/apt/sources.list.d/nexus-apt-hosted.list apt-get update apt-get install -y hello-world apt-cache show hello-world