11

I try to update Debian but I get the following error message:

% sudo aptitude update
Hit http://deb.debian.org/debian bullseye InRelease
Hit http://deb.debian.org/debian-security bullseye-security InRelease
Hit http://deb.debian.org/debian bullseye-updates InRelease
Get: 1 https://cli.github.com/packages stable InRelease [3917 B]
Hit http://packages.azlux.fr/debian buster InRelease
Hit https://fasttrack.debian.net/debian-fasttrack bullseye-fasttrack InRelease
Hit https://fasttrack.debian.net/debian-fasttrack bullseye-backports-staging InRelease
Err https://cli.github.com/packages stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059
Hit https://packages.cloud.google.com/apt kubernetes-xenial InRelease
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://cli.github.com/packages stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059
W: Failed to fetch https://cli.github.com/packages/dists/stable/InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059
W: Some index files failed to download. They have been ignored, or old ones used instead.

It seems related to the following line in my /etc/apt/sources.list.d/github-cli.list:

deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main

So, what to do to fix this signature error?

fauve
  • 245

3 Answers3

24

So, what to do to fix this signature error?

The public key expired on September 2nd, 2022. This provides instructions on how to install the new certificate:

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
Ramhound
  • 44,080
1

I had the same error and was able to fix this by updating the clock

sudo hwclock --hctosys

then

sudo apt update

If PC has been sleeping/hipernating it may cause the hardware clock to be unsynced (im on WSL2). This caused Linux to see an incorrect time, which was too early for updates from the more recent repository.

geuxor
  • 11
  • 2
0

somewhere in your sources files - you might add a 2nd item to your line(s), like in this generic example (from an outdated distro):

deb [trusted=yes] http://archive.debian.org/debian jessie main

(Just in case there is already some rectangular clamps expression, a space is the separator between the provided options in that block.)