How to fix apt error: NO_PUBKEY A2F683C52980AECF


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

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


This error occurs due to the VirtualBox 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 based on the commands from the VirtualBox Linux downloads page):

wget -qO- | sudo gpg --dearmor --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list

and then running

apt update