2

We have a self-hosted Debian repository, from where we are fetching all the packages. While running the "apt update" on target machine, we are getting below error-

W: GPG error: http://URL_FQDN/dev/debian stretch InRelease: The following signatures were invalid: EXPKEYSIG 0DD91A7623XXX9F606 devkey <[email protected]>

Can someone please suggest what is wrong here?

I tried below things-

apt-key adv --keyserver hkp://URL_FQDN:80 --recv-keys 0DD91A7623XXX9F606 
Executing: /tmp/apt-key-gpghome.NeNGQeeH3a/gpg.1.sh --keyserver hkp://URL_FQDN:80 --recv-keys 0DD91A7623XXX9F606 
gpg: keyserver receive failed: No data

apt-key list gives below output (expired):-

apt-key list
/etc/apt/trusted.gpg
--------------------
pub   rsa2048 2018-10-25 [SC] [expires: 2025-08-25]
      89E9 375E AC23 2856 E185  4295 340E 2EE9 XXXX B486
uid           [ unknown] Group <[email protected]>
sub   rsa2048 2018-10-25 [E] [expires: 2025-08-25]

pub   rsa3072 2020-09-28 [SC] [expired: 2022-09-28]
      B899 E7EA 6FFC D59A 152B  B25A 0DD9 1A76 XXXX F606
uid           [ expired] devkey <[email protected]>

gpg --list-keys gives below value:-

gpg --list-keys
/root/.gnupg/pubring.kbx
------------------------
pub   rsa3072 2020-09-28 [SC]
      B899E7EA6FFCD59A152BB25A0DD91A7623XXX9F606 
uid           [ unknown] devkey <[email protected]>
sub   rsa3072 2020-09-28 [E]

2 Answers 2

3

The key used to sign your repository’s artifacts has expired:

pub   rsa3072 2020-09-28 [SC] [expired: 2022-09-28]
      B899 E7EA 6FFC D59A 152B  B25A 0DD9 1A76 XXXX F606
uid           [ expired] devkey <[email protected]>

You need to renew it, and update it wherever it’s used. To move the key’s expiration date, edit it with GPG:

$ gpg --edit-key "B899 E7EA 6FFC D59A 152B  B25A 0DD9 1A76 XXXX F606"
[…]
gpg> expire
Changing expiration time for the primary key.
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0)

and choose an appropriate value.

0

Key was expired on repository server, I extended the expiration there. And then, I tried exporting the public and private keys. And did the scp to my target machine and then added the private key manually.

1. gpg --edit-key B899E7EA6FFCD59A152BB25A0DD91A762XXXX606
2. gpg --export-secret-key 0DD91A762XXXX606 > private. Key
3. scp private. Key to target machine
4. added the key, apt-key add private. Key

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .