A terminal warning reporting a GPG error with the Spotify repository for Linux

Do you use the official Spotify DEB on Ubuntu (or an Ubuntu-based Linux distribution like Linux Mint)?

If so, you’ll be used to receiving updates to the Spotify Linux client direct from the official Spotify APT repo, right alongside all your other DEB-based software.

Thing is: if you haven’t checked for updates from the command line recently you might not be aware the that security key used to ‘sign’ packages from the Spotify APT repo stopped working at the end of last year.

Annoying, but not catastrophic as it—thankfully—doesn’t stop the Spotify Linux app from working just pollutes terminal output with an informative heads-up on the cause of the issue:

Err:9 http://repository.spotify.com stable InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C85668DF69375001
W: GPG error: http://repository.spotify.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C85668DF69375001
E: The repository 'http://repository.spotify.com stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

As noted at the bottom of the error, if you leave the issue unresolved APT policy means you won’t be able to install any updates to the Spotify Linux app from it.

Good news is it’s easy to fix this ‘public key is not available’ error.

So if you use the Spotify DEB, have the official APT repo enabled, see this error, and want to re-add the signed key to continue receiving updates, here’s how to go about it:

  1. Open a new Terminal window and run:
sudo curl -sS https://download.spotify.com/debian/pubkey_C85668DF69375001.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg
  1. You’ll be prompted to overwrite the existing (old) key: press y to confirm.
  2. Then refresh your system’s list of software sources:
sudo apt update
  1. Finally, install any pending Spotify update (if one is available):
sudo apt dist-upgrade

That’s it.

With the Spotify repo key error sorted you’ll get future updates to the client alongside other software updates, be it in the GUI Software Updater tool Ubuntu ships with, the Mint Upgrade assistant on Linux Mint, and so on.

The official Spotify snap (and packages from other sources) are not affected by this issue, only those using the official DEB build from the official APT repository —want to set that up? See the guide to installing Spotify on Linux on OMG! Linux.

Let the music resume!