[Fix] GPG error: https://cli.github.com/packages stable InRelease

The Error “GPG error: https://cli.github.com/packages stable InRelease:”, is an error that is seen when you are working on Github in a linux system.

The error is usually seen when you are trying to use the log-in feature in your site.

Given below is the snippet of the error you might get:

GPG error: https://cli.github.com/packages stable InRelease:

The error, “GPG error: https://cli.github.com/packages stable InRelease: EXPKEYSIG C99B11DEB97541F0” is usually seen because the certificate has been expired as per issuer permission to expire when it was generated.

To fix the error, “GPG error: https://cli.github.com/packages stable InRelease:”, wait for the certificate to be renewed automatically from issuer side or ignore the error and install the package anyways using sudo privilege, however this is not safe from a security perspective.

Lastly you can download the latest release and manually install rather than using apt.

Methods to fix the error “GPG error: https://cli.github.com/packages stable InRelease:” is mentioned below:

Method 1: wait for the certificate to be renewed

First you will have to await the renewal of the certificate till everything returns to normal.

As of  2022-09-07, for this package, a fresh certificate has just been granted.

To resolve the GPG error, run the commands mentioned below:

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

This should help you fix the error, “GPG error: https://cli.github.com/packages stable InRelease: EXPKEYSIG C99B11DEB97541F0”.

Method 2: Install package using Sudo

Secondly you will have to use sudo apt install gh —allow-unauthenticated to continue installing the package despite the error, this is not the safest option from a security viewpoint.

This should help you fix the error, “GPG error: https://cli.github.com/packages stable InRelease: EXPKEYSIG C99B11DEB97541F0”.

Method 3: Download the latest release and manually install rather than using apt

Lastly instead of using apt, download the newest version and perform a manual installation.

To avoid seeing the problem during an update, follow these instructions: sudo apt-key del … && sudo rm /etc/apt/sources.list.d/github-cli.list

This should help you fix the error, “GPG error: https://cli.github.com/packages stable InRelease:”.