How to fix apt error: NO_PUBKEY 458CA832957F5868


When running apt update, you see the following error message:

Err:27 jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 458CA832957F5868



This error occurs due to the Tailscale repo using the outdated (as of April 2022) apt-key method of importing keys.

You can import the key by just installing the tailscale repo again (these commands are listed on the official tailscale installation page):

curl -fsSL | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
curl -fsSL | sudo tee /etc/apt/sources.list.d/tailscale.list

and then running

apt update