Fix nginx Invalid Signing Key

When you encounter the error message:

Err:9 https://nginx.org/packages/ubuntu jammy InRelease
  The following signatures were invalid: EXPKEYSIG ########## nginx signing key <[email protected]>

This indicates that the GPG signing key for the Nginx repository has expired, preventing system updates and potentially blocking Nginx package installations.

Diagnostic Steps

Verify Nginx Repository Configuration

First, check the location of your Nginx repository configuration: cat /etc/apt/sources.list.d/nginx.list

This will show you the current repository entry and help confirm the exact path.

Solution: Updating the Nginx Signing Key

Run the following command to copy the new key:

curl -s https://nginx.org/keys/nginx_signing.key | sudo gpg --dearmor > /path/to/key

So in my case, I run

curl -s https://nginx.org/keys/nginx_signing.key | sudo gpg --dearmor > /usr/share/keyrings/nginx-archive-keyring.gpg

Leave a Comment

Your email address will not be published. Required fields are marked *


Scroll to Top

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close