I wrote this down as I don't like having to install a handful of dependencies just to add a repository (PPA) on Ubuntu.
I used fish in my example.
- Open PPA Page (https://launchpad.net/~fish-shell/+archive/ubuntu/release-3 for example)
- Click Tecnical details about this PPA (green writing)
- Click the signing key link (this goes to https://keyserver.ubuntu.com/pks/lookup?fingerprint=on&op=index&search=0x88421E703EDC7AF54967DED473C9FCC9E2BB48DA)
- Right click the link after sig cert and copy link (This copied link goes in the curl command to get the key)
mkdir -p /etc/apt/keyrings
curl -fsSL 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x73c9fcc9e2bb48da' | gpg --dearmor -o /etc/apt/keyrings/fish.gpg
echo "deb [signed-by=/etc/apt/keyrings/fish.gpg] https://ppa.launchpadcontent.net/fish-shell/release-3/ubuntu/ jammy main" | tee /etc/apt/sources.list.d/fish.list
apt update
apt install fish