Following through the instructions that you are following, at Step 3 or page https://ubuntu.com/tutorials/how-to-verify-ubuntu#3-download-checksums-and-signatures you will see
However, if you didn’t, not to worry - the checksums and the signature
are consistent for the image, so even if you downloaded your ISO file
from a different source, as long as it is fresh and hasn’t been
updated in the interim, you can fetch these files from the
http://releases.ubuntu.com page for the relevant release.
From there you can download the SHA256SUMS and SHA256SUMS.gpg files. I have also conveniently added them here for you:
wget http://releases.ubuntu.com/jammy/SHA256SUMS
wget http://releases.ubuntu.com/jammy/SHA256SUMS.gpg
Now when you run the command of gpg --keyid-format long --verify SHA256SUMS.gpg SHA256SUMS you will probably get something like the following with the missing key:
$ gpg --keyid-format long --verify SHA256SUMS.gpg SHA256SUMS
gpg: Signature made Thu 10 Aug 2023 12:33:07 PM MDT
gpg: using RSA key 843938DF228D22F7B3742BC0D94AA3F0EFE21092
gpg: Can't check signature: No public key
To import your key it is the command from gpg but remember to add 0x to the beginning of the key since it is in hexadecimal format.
gpg --keyid-format long --keyserver hkp://keyserver.ubuntu.com --recv-keys 0x843938DF228D22F7B3742BC0D94AA3F0EFE21092
Now your key check should pass:
gpg --keyid-format long --verify SHA256SUMS.gpg SHA256SUMS
gpg: Signature made Thu 10 Aug 2023 12:33:07 PM MDT
gpg: using RSA key 843938DF228D22F7B3742BC0D94AA3F0EFE21092
gpg: BAD signature from "Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>" [unknown]
Now when you run the sha256sum command it should verify if your downloaded ISO is OK or not:
$ sha256sum -c SHA256SUMS 2>&1 | grep OK
ubuntu-22.04.3-desktop-amd64.iso: OK