How to fix apt error: NO_PUBKEY C5E224500C1289C0


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

Err:2 stable InRelease                                                                                                                                
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C5E224500C1289C0


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

You can import the key using the following commands:

wget -q -O- | gpg --dearmor | sudo tee /usr/share/keyrings/teamviewer-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/teamviewer-archive-keyring.gpg] stable main" > /etc/apt/sources.list.d/teamviewer.list

and then running

apt update