Failed to fetch https://packages.sury.org/php/dists/stretch/InRelease

Executing in a Debian 9 an:

$ apt update

I get this error:

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 couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743
W: Failed to fetch https://packages.sury.org/php/dists/stretch/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743
W: Some index files failed to download. They have been ignored, or old ones used instead.

This is because the DPA has a new signing key. To resolve this problem you have to update the APT signing key, downloading the new key from the repositories:

$ sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
--2019-03-18 21:28:18--  https://packages.sury.org/php/apt.gpg
Resolving packages.sury.org (packages.sury.org)... 2001:bc8:6006:2023:aa1e:84ff:fef1:1eeb, 62.210.94.130
Connecting to packages.sury.org (packages.sury.org)|2001:bc8:6006:2023:aa1e:84ff:fef1:1eeb|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1769 (1.7K) [application/octet-stream]
Saving to: ‘/etc/apt/trusted.gpg.d/php.gpg’

/etc/apt/trusted.gpg.d/php.gpg        100%[=======================================================================>]   1.73K  --.-KB/s    in 0s

2019-03-18 21:28:18 (12.5 MB/s) - ‘/etc/apt/trusted.gpg.d/php.gpg’ saved [1769/1769]

Now the “apt update” works correctly.

Comments

13 responses to “Failed to fetch https://packages.sury.org/php/dists/stretch/InRelease”

  1. Hector Avatar
    Hector

    Thank you

  2. Jacobo Varela Avatar
    Jacobo Varela

    Coñe, vamos a probar 🙂

  3. Goblin Avatar
    Goblin

    That worked for me too. Thanks a lot

  4. Simón Farias Avatar
    Simón Farias

    Thanks. :^)

  5. Gaetan Le Gac Avatar
    Gaetan Le Gac

    I love you

  6. David Avatar
    David

    You’re the best. Thanks!

  7. Gérard Avatar
    Gérard

    Merci !

  8. Jesse Avatar

    The title being the exact error message I was getting is genius. You are my hero.

  9. Niraj Avatar
    Niraj

    I was getting this sudo apt update same issue on raspberry pi.
    The apt update and upgrade worked fine.
    but while restarting the device the device was not working not even booting up.

  10. Zeh Avatar
    Zeh

    Thank you

  11. JuanPablo Avatar
    JuanPablo

    when I run the command to renew the key it gives me the following message:

    root @ websrv01: / home / viper # wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
    –2021-05-18 20: 16: 46– https://packages.sury.org/php/apt.gpg
    Resolving packages.sury.org (packages.sury.org) … 172.67.182.150, 104.21.18.148, 2606: 4700: 3037 :: 6815: 1294, …
    Connecting to packages.sury.org (packages.sury.org) | 172.67.182.150 |: 443 … connected.
    GnuTLS: The TLS connection was non-properly terminated.
    Unable to establish SSL connection.

  12. Viktor Okhotnikov Avatar
    Viktor Okhotnikov

    Thank you! That works!

  13. Ricardo Avatar
    Ricardo

    Para debian 10 , tambien funciona.. jeje
    Un crack

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.