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.
Table of Contents
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