Error Codes Wiki

GPG Key Expired — Package Signature Verification and Key Management Errors

Warningsecurity

Overview

Fix GPG key expired errors that prevent package installation, repository updates, and signature verification on Linux systems.

Key Details

  • GPG (GNU Privacy Guard) keys are used to sign and verify packages, repositories, and files
  • Package managers (apt, yum/dnf) verify repository signatures using GPG keys
  • Keys have expiration dates and must be renewed or replaced when they expire
  • Expired keys cause 'EXPKEYSIG' or 'NO_PUBKEY' errors during package updates
  • Third-party repository keys are the most common source of expired key issues

Common Causes

  • Repository GPG signing key expired and the system has the old key cached
  • Third-party repository has not been updated with the new key
  • System date is incorrect, making valid keys appear expired
  • GPG key was not properly added when the repository was configured

Steps

  1. 1Identify the expired key: the error message includes the key ID (e.g., EXPKEYSIG 1234ABCD)
  2. 2Refresh the key from the keyserver: 'sudo gpg --keyserver keyserver.ubuntu.com --recv-keys KEY_ID'
  3. 3For apt: 'sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com KEY_ID' (deprecated) or use signed-by
  4. 4Check system date: 'date' — if incorrect, fix with 'sudo timedatectl set-ntp true'
  5. 5For persistent issues: download the current key from the repository's website and add it manually

Tags

gpgkey-expiredpackage-managersignatureapt

Related Items

More in Security

Frequently Asked Questions

Not recommended. GPG verification ensures packages are from trusted sources and have not been tampered with. Ignoring key errors (--allow-unauthenticated) bypasses this security check and could allow malicious packages.