title: "An error occurred during the signature verification." in apt-update after adding key 3A79BD29 and sudo apt-key del <old-key> on Debian
body: <p>the server I work on is a Debian 9.13 OS and &quot;mysql  Ver 14.14 Distrib 5.7.34,&quot;.
  I tried downloading package information from all configured sources with the following command:</p>
  <pre><code>sudo apt update
  </code></pre>
  <p>then I faced to the following error:</p>
  <pre><code>Hit:1 http://security.debian.org stretch/updates InRelease
  Hit:2 http://packages.cloud.google.com/apt google-cloud-monitoring-stretch-all InRelease
  Hit:3 http://packages.cloud.google.com/apt cloud-sdk-stretch InRelease
  Hit:4 http://packages.cloud.google.com/apt google-compute-engine-stretch-stable InRelease
  Ign:5 http://deb.debian.org/debian stretch InRelease
  Hit:6 http://repo.mysql.com/apt/debian stretch InRelease
  Hit:7 http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-stretch InRelease
  Hit:8 http://deb.debian.org/debian stretch-updates InRelease
  Hit:9 https://packages.cloud.google.com/apt google-cloud-logging-stretch-all InRelease
  Hit:10 http://deb.debian.org/debian stretch-backports InRelease
  Hit:11 http://deb.debian.org/debian stretch Release
  Get:12 https://packages.sury.org/php stretch InRelease [6,839 B]
  Err:6 http://repo.mysql.com/apt/debian stretch InRelease
    The following signatures were invalid: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;
  Err:12 https://packages.sury.org/php stretch InRelease
    The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key &lt;deb@sury.org&gt;
  Fetched 6,839 B in 1s (5,504 B/s)
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  10 packages can be upgraded. Run 'apt list --upgradable' to see them.
  W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/debian stretch InRelease: The following signatures were invalid: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;
  W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.sury.org/php stretch InRelease: The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key &lt;deb@sury.org&gt;
  W: Failed to fetch http://repo.mysql.com/apt/debian/dists/stretch/InRelease  The following signatures were invalid: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;
  W: Failed to fetch https://packages.sury.org/php/dists/stretch/InRelease  The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key &lt;deb@sury.org&gt;
  W: Some index files failed to download. They have been ignored, or old ones used instead.
  </code></pre>
  <p>then for fixing the issue of expired signatures I did a long journey, and faced to some problems , so I thought maybe I did something wrong, so I explain the setps I followed in details.
  after reseacrh I conculded to update expired keys as the following:</p>
  <pre><code>sudo apt-key list
  </code></pre>
  <p>then I saw this:</p>
  <pre><code>/etc/apt/trusted.gpg
  --------------------
  pub   dsa1024 2003-02-03 [SCA] [expired: 2022-02-16]
        A4A9 4068 76FC BD3C 4567  70C8 8C71 8D3B 5072 E1F5
  uid           [ expired] MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;
  
  pub   rsa3072 2019-03-18 [SC] [expired: 2021-03-17]
        1505 8500 A023 5D97 F5D1  0063 B188 E2B6 95BD 4743
  uid           [ expired] DEB.SURY.ORG Automatic Signing Key &lt;deb@sury.org&gt;
  
  /etc/apt/trusted.gpg.d/debian-archive-bullseye-automatic.gpg
  ------------------------------------------------------------
  pub   rsa4096 2021-01-17 [SC] [expires: 2029-01-15]
        1F89 983E 0081 FDE0 18F3  CC96 73A4 F27B 8DD4 7936
  uid           [ unknown] Debian Archive Automatic Signing Key (11/bullseye) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2021-01-17 [S] [expires: 2029-01-15]
  
  /etc/apt/trusted.gpg.d/debian-archive-bullseye-security-automatic.gpg
  ---------------------------------------------------------------------
  pub   rsa4096 2021-01-17 [SC] [expires: 2029-01-15]
        AC53 0D52 0F2F 3269 F5E9  8313 A484 4904 4AAD 5C5D
  uid           [ unknown] Debian Security Archive Automatic Signing Key (11/bullseye) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2021-01-17 [S] [expires: 2029-01-15]
  
  /etc/apt/trusted.gpg.d/debian-archive-bullseye-stable.gpg
  ---------------------------------------------------------
  pub   rsa4096 2021-02-13 [SC] [expires: 2029-02-11]
        A428 5295 FC7B 1A81 6000  62A9 605C 66F0 0D6C 9793
  uid           [ unknown] Debian Stable Release Key (11/bullseye) &lt;debian-release@lists.debian.org&gt;
  
  /etc/apt/trusted.gpg.d/debian-archive-buster-automatic.gpg
  ----------------------------------------------------------
  pub   rsa4096 2019-04-14 [SC] [expires: 2027-04-12]
        80D1 5823 B7FD 1561 F9F7  BCDD DC30 D7C2 3CBB ABEE
  uid           [ unknown] Debian Archive Automatic Signing Key (10/buster) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2019-04-14 [S] [expires: 2027-04-12]
  
  /etc/apt/trusted.gpg.d/debian-archive-buster-security-automatic.gpg
  -------------------------------------------------------------------
  pub   rsa4096 2019-04-14 [SC] [expires: 2027-04-12]
        5E61 B217 265D A980 7A23  C5FF 4DFA B270 CAA9 6DFA
  uid           [ unknown] Debian Security Archive Automatic Signing Key (10/buster) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2019-04-14 [S] [expires: 2027-04-12]
  
  /etc/apt/trusted.gpg.d/debian-archive-buster-stable.gpg
  -------------------------------------------------------
  pub   rsa4096 2019-02-05 [SC] [expires: 2027-02-03]
        6D33 866E DD8F FA41 C014  3AED DCC9 EFBF 77E1 1517
  uid           [ unknown] Debian Stable Release Key (10/buster) &lt;debian-release@lists.debian.org&gt;
  
  /etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg
  ----------------------------------------------------------
  pub   rsa4096 2014-11-21 [SC] [expires: 2022-11-19]
        126C 0D24 BD8A 2942 CC7D  F8AC 7638 D044 2B90 D010
  uid           [ unknown] Debian Archive Automatic Signing Key (8/jessie) &lt;ftpmaster@debian.org&gt;
  
  /etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg
  -------------------------------------------------------------------
  pub   rsa4096 2014-11-21 [SC] [expires: 2022-11-19]
        D211 6914 1CEC D440 F2EB  8DDA 9D6D 8F6B C857 C906
  uid           [ unknown] Debian Security Archive Automatic Signing Key (8/jessie) &lt;ftpmaster@debian.org&gt;
  
  /etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg
  -------------------------------------------------------
  pub   rsa4096 2013-08-17 [SC] [expired: 2021-08-15]
        75DD C3C4 A499 F1A1 8CB5  F3C8 CBF8 D6FD 518E 17E1
  uid           [ expired] Jessie Stable Release Key &lt;debian-release@lists.debian.org&gt;
  
  /etc/apt/trusted.gpg.d/debian-archive-stretch-automatic.gpg
  -----------------------------------------------------------
  pub   rsa4096 2017-05-22 [SC] [expires: 2025-05-20]
        E1CF 20DD FFE4 B89E 8026  58F1 E0B1 1894 F66A EC98
  uid           [ unknown] Debian Archive Automatic Signing Key (9/stretch) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2017-05-22 [S] [expires: 2025-05-20]
  
  /etc/apt/trusted.gpg.d/debian-archive-stretch-security-automatic.gpg
  --------------------------------------------------------------------
  pub   rsa4096 2017-05-22 [SC] [expires: 2025-05-20]
        6ED6 F5CB 5FA6 FB2F 460A  E88E EDA0 D238 8AE2 2BA9
  uid           [ unknown] Debian Security Archive Automatic Signing Key (9/stretch) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2017-05-22 [S] [expires: 2025-05-20]
  
  /etc/apt/trusted.gpg.d/debian-archive-stretch-stable.gpg
  --------------------------------------------------------
  pub   rsa4096 2017-05-20 [SC] [expires: 2025-05-18]
        067E 3C45 6BAE 240A CEE8  8F6F EF0F 382A 1A7B 6500
  uid           [ unknown] Debian Stable Release Key (9/stretch) &lt;debian-release@lists.debian.org&gt;
  
  /etc/apt/trusted.gpg.d/google-cloud-packages-archive-keyring.gpg
  ----------------------------------------------------------------
  pub   rsa2048 2021-03-01 [SC] [expires: 2023-03-02]
        7F92 E05B 3109 3BEF 5A3C  2D38 FEEA 9169 307E A071
  uid           [ unknown] Rapture Automatic Signing Key (cloud-rapture-signing-key-2021-03-01-08_01_09.pub)
  sub   rsa2048 2021-03-01 [E]
  
  pub   rsa2048 2020-12-04 [SC] [expires: 2022-12-04]
        59FE 0256 8272 69DC 8157  8F92 8B57 C5C2 836F 4BEB
  uid           [ unknown] gLinux Rapture Automatic Signing Key (//depot/google3/production/borg/cloud-rapture/keys/cloud-rapture-pubkeys/cloud-rapture-signing-key-2020-12-03-16_08_05.pub) &lt;glinux-team@google.com&gt;
  sub   rsa2048 2020-12-04 [E]
  </code></pre>
  <p>so as it is shown here the three key are expired:</p>
  <pre><code>pub   dsa1024 2003-02-03 [SCA] [expired: 2022-02-16]
        A4A9 4068 76FC BD3C 4567  70C8 8C71 8D3B 5072 E1F5
  uid           [ expired] MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;
  
  pub   rsa3072 2019-03-18 [SC] [expired: 2021-03-17]
        1505 8500 A023 5D97 F5D1  0063 B188 E2B6 95BD 4743
  uid           [ expired] DEB.SURY.ORG Automatic Signing Key &lt;deb@sury.org&gt;
  
  pub   rsa4096 2013-08-17 [SC] [expired: 2021-08-15]
        75DD C3C4 A499 F1A1 8CB5  F3C8 CBF8 D6FD 518E 17E1
  uid           [ expired] Jessie Stable Release Key &lt;debian-release@lists.debian.org&gt;
  </code></pre>
  <p>so I tried the following command:</p>
  <pre><code>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
  </code></pre>
  <p>result:</p>
  <pre><code>Executing: /tmp/apt-key-gpghome.8n1JFs3V5i/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
  gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
  gpg: connecting dirmngr at '/tmp/apt-key-gpghome.8n1JFs3V5i/S.dirmngr' failed: No such file or directory
  gpg: keyserver receive failed: No dirmngr
  </code></pre>
  <p>so after research, I did the following:</p>
  <pre><code>sudo apt install dirmngr --install-recommends
  </code></pre>
  <p>result:</p>
  <pre><code>Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  Suggested packages:
    dbus-user-session libpam-systemd pinentry-gnome3 tor
  The following NEW packages will be installed:
    dirmngr
  0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
  2 not fully installed or removed.
  Need to get 597 kB of archives.
  After this operation, 1,114 kB of additional disk space will be used.
  Get:1 http://deb.debian.org/debian stretch/main amd64 dirmngr amd64 2.1.18-8~deb9u4 [597 kB]
  Fetched 597 kB in 0s (7,412 kB/s)
  Selecting previously unselected package dirmngr.
  (Reading database ... 68920 files and directories currently installed.)
  Preparing to unpack .../dirmngr_2.1.18-8~deb9u4_amd64.deb ...
  Unpacking dirmngr (2.1.18-8~deb9u4) ...
  Processing triggers for man-db (2.7.6.1-2) ...
  Setting up dirmngr (2.1.18-8~deb9u4) ...
  Setting up google-fluentd (1.8.7-1) ...
  Conffile /etc/google-fluentd/google-fluentd.conf has been modified. Remain untouched.
  Conffile /etc/google-fluentd/baseline/google-fluentd.conf has been modified. Remain untouched.
  Job for google-fluentd.service failed because the control process exited with error code.
  See &quot;systemctl status google-fluentd.service&quot; and &quot;journalctl -xe&quot; for details.
  invoke-rc.d: initscript google-fluentd, action &quot;start&quot; failed.
  ● google-fluentd.service - LSB: data collector for Treasure Data
     Loaded: loaded (/etc/init.d/google-fluentd; generated; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2022-04-21 16:26:02 UTC; 9ms ago
       Docs: man:systemd-sysv-generator(8)
    Process: 21302 ExecStart=/etc/init.d/google-fluentd start (code=exited, status=1/FAILURE)
  
  Apr 21 16:26:02 marketing-vm systemd[1]: Starting LSB: data collector for Treasure Data...
  Apr 21 16:26:02 marketing-vm google-fluentd[21302]: Starting google-fluentd 1.8.7: Disabled via metadata ... (warning).
  Apr 21 16:26:02 marketing-vm google-fluentd[21302]: google-fluentd ... failed!
  Apr 21 16:26:02 marketing-vm systemd[1]: google-fluentd.service: Control process exited, code=exited status=1
  Apr 21 16:26:02 marketing-vm systemd[1]: Failed to start LSB: data collector for Treasure Data.
  Apr 21 16:26:02 marketing-vm systemd[1]: google-fluentd.service: Unit entered failed state.
  Apr 21 16:26:02 marketing-vm systemd[1]: google-fluentd.service: Failed with result 'exit-code'.
  dpkg: error processing package google-fluentd (--configure):
   subprocess installed post-installation script returned error exit status 1
  dpkg: dependency problems prevent configuration of google-fluentd-catch-all-config:
   google-fluentd-catch-all-config depends on google-fluentd (&gt;= 1.3.0); however:
    Package google-fluentd is not configured yet.
  
  dpkg: error processing package google-fluentd-catch-all-config (--configure):
   dependency problems - leaving unconfigured
  Errors were encountered while processing:
   google-fluentd
   google-fluentd-catch-all-config
  E: Sub-process /usr/bin/dpkg returned an error code (1)
  </code></pre>
  <p>I ran the following command after research and the result after that:</p>
  <pre><code>admin@marketing-vm:~$ systemctl status google-fluentd.service
  Failed to connect to bus: No such file or directory
  </code></pre>
  <p>how ever this returned an error but it seems that required dirmngr was installed succesfully and I assumed this is something related to google cloud server and I ingnored research about it. but if you know what should I do regarding it I will be appreciate it. but let's continue as it is not my main issue
  then I tried the following command again</p>
  <pre><code>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
  </code></pre>
  <p>result:</p>
  <pre><code>Executing: /tmp/apt-key-gpghome.q3eZMOsbBP/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
  gpg: key 8C718D3B5072E1F5: 4 duplicate signatures removed
  gpg: key 8C718D3B5072E1F5: 60 signatures not checked due to missing keys
  gpg: key 8C718D3B5072E1F5: &quot;MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;&quot; 33 new signatures
  gpg: Total number processed: 1
  gpg:         new signatures: 33
  </code></pre>
  <p>and</p>
  <pre><code>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15058500A0235D97F5D10063B188E2B695BD4743
  </code></pre>
  <p>result:</p>
  <pre><code>Executing: /tmp/apt-key-gpghome.NYzCNLi5bV/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 15058500A0235D97F5D10063B188E2B695BD4743
  gpg: key B188E2B695BD4743: 1 signature not checked due to a missing key
  gpg: key B188E2B695BD4743: &quot;DEB.SURY.ORG Automatic Signing Key &lt;deb@sury.org&gt;&quot; 3 new signatures
  gpg: Total number processed: 1
  gpg:         new signatures: 3
  </code></pre>
  <p>and</p>
  <pre><code>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 75DDC3C4A499F1A18CB5F3C8CBF8D6FD518E17E1
  </code></pre>
  <p>result:</p>
  <pre><code>Executing: /tmp/apt-key-gpghome.shHWXIw0ob/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 75DDC3C4A499F1A18CB5F3C8CBF8D6FD518E17E1
  gpg: key CBF8D6FD518E17E1: 12 signatures not checked due to missing keys
  gpg: key CBF8D6FD518E17E1: &quot;Jessie Stable Release Key &lt;debian-release@lists.debian.org&gt;&quot; 10 new signatures
  gpg: Total number processed: 1
  gpg:         new signatures: 10
  </code></pre>
  <p>then when I ran <code>sudo apt update</code> I just saw only one remaining signature issue:</p>
  <pre><code>Hit:1 http://packages.cloud.google.com/apt google-cloud-monitoring-stretch-all InRelease
  Ign:2 http://deb.debian.org/debian stretch InRelease
  Hit:3 http://deb.debian.org/debian stretch-updates InRelease
  Hit:4 http://deb.debian.org/debian stretch-backports InRelease
  Hit:5 http://security.debian.org stretch/updates InRelease
  Hit:6 http://packages.cloud.google.com/apt cloud-sdk-stretch InRelease
  Hit:7 http://packages.cloud.google.com/apt google-compute-engine-stretch-stable InRelease
  Hit:8 http://repo.mysql.com/apt/debian stretch InRelease
  Hit:9 http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-stretch InRelease
  Hit:10 http://deb.debian.org/debian stretch Release
  Hit:11 https://packages.cloud.google.com/apt google-cloud-logging-stretch-all InRelease
  Get:12 https://packages.sury.org/php stretch InRelease [6,839 B]
  Err:8 http://repo.mysql.com/apt/debian stretch InRelease
    The following signatures were invalid: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;
  Get:14 https://packages.sury.org/php stretch/main amd64 Packages [356 kB]
  Fetched 363 kB in 2s (149 kB/s)
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  26 packages can be upgraded. Run 'apt list --upgradable' to see them.
  W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/debian stretch InRelease: The following signatures were invalid: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;
  W: Failed to fetch http://repo.mysql.com/apt/debian/dists/stretch/InRelease  The following signatures were invalid: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;
  W: Some index files failed to download. They have been ignored, or old ones used instead.
  </code></pre>
  <p>maybe I was wrong but I did the following based on the log again:</p>
  <pre><code>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8C718D3B5072E1F5
  </code></pre>
  <p>result:</p>
  <pre><code>gpg: key 8C718D3B5072E1F5: 4 duplicate signatures removed
  gpg: key 8C718D3B5072E1F5: 60 signatures not checked due to missing keys
  gpg: key 8C718D3B5072E1F5: &quot;MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;&quot; not changed
  gpg: Total number processed: 1
  gpg:              unchanged: 1
  </code></pre>
  <p>so I searched about it and I followed the instructions on the following documentation:</p>
  <p><a href="https://dev.mysql.com/doc/refman/8.0/en/checking-gpg-signature.html" rel="nofollow noreferrer">https://dev.mysql.com/doc/refman/8.0/en/checking-gpg-signature.html</a></p>
  <p>based on of what was recommened as here which was reported same issue:</p>
  <p><a href="https://ubuntuforums.org/showthread.php?t=2415997" rel="nofollow noreferrer">https://ubuntuforums.org/showthread.php?t=2415997</a></p>
  <p>as following:</p>
  <pre><code>sudo nano /home/admin/mysql_pubkey.asc
  </code></pre>
  <p>and I copy and paste the PGP PUBLIC KEY BLOCK mentioned in the documentation there. and saved it.
  then:</p>
  <pre><code>gpg --import /home/admin/mysql_pubkey.asc
  </code></pre>
  <p>result:</p>
  <pre><code>gpg: /home/admin/.gnupg/trustdb.gpg: trustdb created
  gpg: key 467B942D3A79BD29: public key &quot;MySQL Release Engineering &lt;mysql-build@os                                                                                                                     s.oracle.com&gt;&quot; imported
  gpg: Total number processed: 1
  gpg:               imported: 1
  </code></pre>
  <p>then I copied the public key to txt file then I did this:</p>
  <pre><code>sudo apt-key add mysql_pubkey.txt
  </code></pre>
  <p>result:</p>
  <pre><code>OK
  </code></pre>
  <p>I do not know why the key 467B942D3A79BD29 is different from what document says which is 3A79BD29
  . any way now when I run <code>sudo apt-key list</code> I see the following keys:</p>
  <pre><code>/etc/apt/trusted.gpg
  --------------------
  pub   rsa3072 2019-03-18 [SC] [expires: 2024-02-16]
        1505 8500 A023 5D97 F5D1  0063 B188 E2B6 95BD 4743
  uid           [ unknown] DEB.SURY.ORG Automatic Signing Key &lt;deb@sury.org&gt;
  sub   rsa3072 2019-03-18 [E] [expires: 2024-02-16]
  
  pub   rsa4096 2021-12-14 [SC] [expires: 2023-12-14]
        859B E8D7 C586 F538 430B  19C2 467B 942D 3A79 BD29
  uid           [ unknown] MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;
  sub   rsa4096 2021-12-14 [E] [expires: 2023-12-14]
  
  /etc/apt/trusted.gpg.d/debian-archive-bullseye-automatic.gpg
  ------------------------------------------------------------
  pub   rsa4096 2021-01-17 [SC] [expires: 2029-01-15]
        1F89 983E 0081 FDE0 18F3  CC96 73A4 F27B 8DD4 7936
  uid           [ unknown] Debian Archive Automatic Signing Key (11/bullseye) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2021-01-17 [S] [expires: 2029-01-15]
  
  /etc/apt/trusted.gpg.d/debian-archive-bullseye-security-automatic.gpg
  ---------------------------------------------------------------------
  pub   rsa4096 2021-01-17 [SC] [expires: 2029-01-15]
        AC53 0D52 0F2F 3269 F5E9  8313 A484 4904 4AAD 5C5D
  uid           [ unknown] Debian Security Archive Automatic Signing Key (11/bullseye) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2021-01-17 [S] [expires: 2029-01-15]
  
  /etc/apt/trusted.gpg.d/debian-archive-bullseye-stable.gpg
  ---------------------------------------------------------
  pub   rsa4096 2021-02-13 [SC] [expires: 2029-02-11]
        A428 5295 FC7B 1A81 6000  62A9 605C 66F0 0D6C 9793
  uid           [ unknown] Debian Stable Release Key (11/bullseye) &lt;debian-release@lists.debian.org&gt;
  
  /etc/apt/trusted.gpg.d/debian-archive-buster-automatic.gpg
  ----------------------------------------------------------
  pub   rsa4096 2019-04-14 [SC] [expires: 2027-04-12]
        80D1 5823 B7FD 1561 F9F7  BCDD DC30 D7C2 3CBB ABEE
  uid           [ unknown] Debian Archive Automatic Signing Key (10/buster) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2019-04-14 [S] [expires: 2027-04-12]
  
  /etc/apt/trusted.gpg.d/debian-archive-buster-security-automatic.gpg
  -------------------------------------------------------------------
  pub   rsa4096 2019-04-14 [SC] [expires: 2027-04-12]
        5E61 B217 265D A980 7A23  C5FF 4DFA B270 CAA9 6DFA
  uid           [ unknown] Debian Security Archive Automatic Signing Key (10/buster) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2019-04-14 [S] [expires: 2027-04-12]
  
  /etc/apt/trusted.gpg.d/debian-archive-buster-stable.gpg
  -------------------------------------------------------
  pub   rsa4096 2019-02-05 [SC] [expires: 2027-02-03]
        6D33 866E DD8F FA41 C014  3AED DCC9 EFBF 77E1 1517
  uid           [ unknown] Debian Stable Release Key (10/buster) &lt;debian-release@lists.debian.org&gt;
  
  /etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg
  ----------------------------------------------------------
  pub   rsa4096 2014-11-21 [SC] [expires: 2022-11-19]
        126C 0D24 BD8A 2942 CC7D  F8AC 7638 D044 2B90 D010
  uid           [ unknown] Debian Archive Automatic Signing Key (8/jessie) &lt;ftpmaster@debian.org&gt;
  
  /etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg
  -------------------------------------------------------------------
  pub   rsa4096 2014-11-21 [SC] [expires: 2022-11-19]
        D211 6914 1CEC D440 F2EB  8DDA 9D6D 8F6B C857 C906
  uid           [ unknown] Debian Security Archive Automatic Signing Key (8/jessie) &lt;ftpmaster@debian.org&gt;
  
  /etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg
  -------------------------------------------------------
  pub   rsa4096 2013-08-17 [SC] [expired: 2021-08-15]
        75DD C3C4 A499 F1A1 8CB5  F3C8 CBF8 D6FD 518E 17E1
  uid           [ expired] Jessie Stable Release Key &lt;debian-release@lists.debian.org&gt;
  
  /etc/apt/trusted.gpg.d/debian-archive-stretch-automatic.gpg
  -----------------------------------------------------------
  pub   rsa4096 2017-05-22 [SC] [expires: 2025-05-20]
        E1CF 20DD FFE4 B89E 8026  58F1 E0B1 1894 F66A EC98
  uid           [ unknown] Debian Archive Automatic Signing Key (9/stretch) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2017-05-22 [S] [expires: 2025-05-20]
  
  /etc/apt/trusted.gpg.d/debian-archive-stretch-security-automatic.gpg
  --------------------------------------------------------------------
  pub   rsa4096 2017-05-22 [SC] [expires: 2025-05-20]
        6ED6 F5CB 5FA6 FB2F 460A  E88E EDA0 D238 8AE2 2BA9
  uid           [ unknown] Debian Security Archive Automatic Signing Key (9/stretch) &lt;ftpmaster@debian.org&gt;
  sub   rsa4096 2017-05-22 [S] [expires: 2025-05-20]
  
  /etc/apt/trusted.gpg.d/debian-archive-stretch-stable.gpg
  --------------------------------------------------------
  pub   rsa4096 2017-05-20 [SC] [expires: 2025-05-18]
        067E 3C45 6BAE 240A CEE8  8F6F EF0F 382A 1A7B 6500
  uid           [ unknown] Debian Stable Release Key (9/stretch) &lt;debian-release@lists.debian.org&gt;
  
  /etc/apt/trusted.gpg.d/google-cloud-packages-archive-keyring.gpg
  ----------------------------------------------------------------
  pub   rsa2048 2021-03-01 [SC] [expires: 2023-03-02]
        7F92 E05B 3109 3BEF 5A3C  2D38 FEEA 9169 307E A071
  uid           [ unknown] Rapture Automatic Signing Key (cloud-rapture-signing-key-2021-03-01-08_01_09.pub)
  sub   rsa2048 2021-03-01 [E]
  
  pub   rsa2048 2020-12-04 [SC] [expires: 2022-12-04]
        59FE 0256 8272 69DC 8157  8F92 8B57 C5C2 836F 4BEB
  uid           [ unknown] gLinux Rapture Automatic Signing Key (//depot/google3/production/borg/cloud-rapture/keys/cloud-rapture-pubkeys/cloud-rapture-signing-key-2020-12-03-16_08_05.pub) &lt;glinux-team@google.com&gt;
  sub   rsa2048 2020-12-04 [E]
  </code></pre>
  <p>but still I face same result when I run <code>sudo apt update</code></p>
  <pre><code>Hit:1 http://packages.cloud.google.com/apt google-cloud-monitoring-stretch-all InRelease
  Ign:2 http://deb.debian.org/debian stretch InRelease
  Hit:3 http://security.debian.org stretch/updates InRelease
  Hit:4 http://packages.cloud.google.com/apt cloud-sdk-stretch InRelease
  Hit:5 http://deb.debian.org/debian stretch-updates InRelease
  Hit:6 http://packages.cloud.google.com/apt google-compute-engine-stretch-stable InRelease
  Hit:7 http://deb.debian.org/debian stretch-backports InRelease
  Hit:8 http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-stretch InRelease
  Hit:9 http://deb.debian.org/debian stretch Release
  Hit:10 http://repo.mysql.com/apt/debian stretch InRelease
  Hit:11 https://packages.cloud.google.com/apt google-cloud-logging-stretch-all InRelease
  Hit:12 https://packages.sury.org/php stretch InRelease
  Err:10 http://repo.mysql.com/apt/debian stretch InRelease
    The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8C718D3B5072E1F5
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  26 packages can be upgraded. Run 'apt list --upgradable' to see them.
  W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/debian stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8C718D3B5072E1F5
  W: Failed to fetch http://repo.mysql.com/apt/debian/dists/stretch/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8C718D3B5072E1F5
  W: Some index files failed to download. They have been ignored, or old ones used instead.
  </code></pre>
  <p>I also tried</p>
  <pre><code>gpg --delete-key 8C718D3B5072E1F5
  </code></pre>
  <p>result:</p>
  <pre><code>gpg (GnuPG) 2.1.18; Copyright (C) 2017 Free Software Foundation, Inc.
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  
  gpg: key &quot;8C718D3B5072E1F5&quot; not found: Not found
  gpg: 8C718D3B5072E1F5: delete key failed: Not found
  </code></pre>
  <p>and</p>
  <pre><code> gpg --keyid-format=long --with-fingerprint --list-keys 8C718D3B5072E1F5
  </code></pre>
  <p>result:</p>
  <pre><code>gpg: error reading key: No public key
  </code></pre>
  <p>i will appreciate it if you can help me to solve this issue</p>