When PGP/GPG keys expire, you have option to generate a sub key (if you think your key has been compromised), or you can extend the validity of the current key by extending it’s expiry period. You can extend the key’s expiry period since the keys are not compromised. To continue, Open a terminal window and enter following commands.
$ gpg --list-keys <enter>
Lists all public keys
$ gpg --list-secret-keys <enter>
Lists all secret keys
$ gpg --edit-key 0x21221AC8 <enter>
where 0x21221AC8 is the key ID of key 1
First, the public key.
gpg> key 1 <enter>
gpg> expire <enter>
Enter how long key should be valid
Then, the private key.
gpg> key 1 <enter>
gpg> expire <enter>
Enter how long the key used for encryption should be valid
gpg> save <enter>
Done. Don’t forget to publish it a key server. If you want to understand how GPG/PGP works, see how to work with privacy guard gnupg gpg or pgp for encryption.