Source
gpg --edit-key KEYID
In the GPG prompt:
gpg> expire
Now choose a new expiry date (e.g. 2y
for 2 years)
Optionally, do this for all subkeys (the primary key is 0
):
gpg> key 1
gpg> key 2
...
gpg> expire
Since the key has changed it needs to be trusted again:
gpg> trust
Finally, save the changes:
gpg> save
Then, export the key again and publish it to a key server.