Score:0

How to fix this apt update keyring issue relating to gh?

cn flag

I have this error associated with gh (github commandline).

$ sudo apt update
...                                                                                                            
Get:3 https://cli.github.com/packages stable InRelease [3,917 B]                                                                                                                     
Err:3 https://cli.github.com/packages stable InRelease                                                                                        
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059
...
Fetched 338 kB in 2s (154 kB/s)    
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
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's installation commands are:

type -p curl >/dev/null || sudo apt install curl -y
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

I think this means an issue relating to /usr/share/keyrings/githubcli-archive-keyring.gpg. I have uninstalled gh.

How do I remove this issue during sudo apt update?

muru avatar
us flag
If you don't want the GitHub repo, you can delete the file in which that repo is configured (`/etc/apt/sources.list.d/github-cli.list`, from the commands you have listed)
Sun Bear avatar
cn flag
@muru Thank. I removed files `/etc/apt/sources.list.d/github-cli.list`, `/etc/apt/sources.list.d/github-cli.list.distUpgrade`, `/etc/apt/sources.list.d/github-cli.list.save`. Issues solved.
Score:0
cn flag

Following @muru comment, I removed files /etc/apt/sources.list.d/github-cli.list, /etc/apt/sources.list.d/github-cli.list.distUpgrade, /etc/apt/sources.list.d/github-cli.list.save. Issues solved.

Sidenote: After upgrading from Ubuntu 20.04 to 22.04, I also found many focal (i.e. Ubuntu 20.04) files in /etc/apt/sources.list.d. I removed these old files too.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.