skribe
February 7, 2026, 2:00am
1
A few days ago, the signing key deb.sury.org expired, and I can’t find a way to update to the latest key. I’ve tried the script (https://packages.sury.org/php/README.txt ) on deb.sury.org , but it keeps downloading the old key. Is there something else I need to do?
Cheers!
Use this:
curl -s https://packages.sury.org/php/apt.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/sury-keyring.gpg >/dev/null
But you should check that /etc/apt/sources.list.d/php.list is using the right path to the key /usr/share/keyrings/sury-keyring.gpg
1 Like
skribe
February 7, 2026, 2:57am
3
/etc/apt/sources.list.d/php.list:
deb [signed-by=/usr/share/keyrings/debsuryorg-archive-keyring.gpg] https://packages.sury.org/php/` bookworm main`
I’m guessing that’s not right.
That’s just a name. Or you use this command and then replace the name in php.list
curl -s https://packages.sury.org/php/apt.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/sury-keyring.gpg >/dev/null
Or you use this command so don’t need to change the name in php.list:
curl -s https://packages.sury.org/php/apt.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/debsuryorg-archive-keyring.gpg >/dev/null
skribe
February 7, 2026, 3:12am
5
sahsanu:
sury-keyring.gpg
Thanks for your help so far. It’s still not working.
I have tried both methods and sudo apt update features this:
Err:8 https://packages.sury.org/php/` bookworm InRelease
418 I’m a teapot [IP: 199.232.115.52 443]
Get:1 file:/etc/apt/mirrors/debian.list Mirrorlist [30 B]
Get:2 file:/etc/apt/mirrors/debian-security.list Mirrorlist [39 B]
Hit:7 https://packages.sury.org/apache2 bookworm InRelease
Hit:3 Index of /debian bookworm InRelease
Err:8 https://packages.sury.org/php/` bookworm InRelease
418 I’m a teapot [IP: 199.232.115.52 443]
Hit:4 Index of /debian bookworm-updates InRelease
Hit:5 Index of /debian bookworm-backports InRelease
Hit:6 https://deb.debian.org/debian-security bookworm-security InRelease
Err:7 https://packages.sury.org/apache2 bookworm InRelease
The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key [email protected]
Hit:9 https://apt.hestiacp.com bookworm InRelease
Hit:10 Index of /packages/mainline/debian/ bookworm InRelease
Reading package lists… Done
E: Failed to fetch https://packages.sury.org/php/`/dists/bookworm/InRelease 418 I’m a teapot [IP: 199.232.115.52 443]
E: The repository ‘https://packages.sury.org/php/` bookworm InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
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/apache2 bookworm InRelease: The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key [email protected]
You must also change the apache.list file and there is a typo in the repo.
Show me the output of these commands:
cat -A /etc/apt/sources.list.d/php.list
cat -A /etc/apt/sources.list.d/apache2.list
Next time, paste the output, select the text and Ctrl+E or click on icon </>
To fix it:
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/sury-keyring.gpg] https://packages.sury.org/apache2/ bookworm main' > /etc/apt/sources.list.d/apache2.list
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/sury-keyring.gpg] https://packages.sury.org/php/ bookworm main' > /etc/apt/sources.list.d/php.list
apt update
1 Like
skribe
February 7, 2026, 6:43am
9
Tried both as written and using sudo and….:
-bash: /etc/apt/sources.list.d/apache2.list: Permission denied
-bash: /etc/apt/sources.list.d/php.list: Permission denied
This is fun
sahsanu
February 7, 2026, 7:22am
10
Before executing the commands login as root.
sudo -i
Or use these commands:
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/sury-keyring.gpg] https://packages.sury.org/apache2/ bookworm main' | sudo tee /etc/apt/sources.list.d/apache2.list >/dev/null
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/sury-keyring.gpg] https://packages.sury.org/php/ bookworm main' | sudo tee /etc/apt/sources.list.d/php.list >/dev/null
sudo apt update
nu01
February 7, 2026, 9:28am
11
Facing the same issue, and tried fixing, but it gives the expired signature error even after that:
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/apache2`` bookworm InRelease: The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 ``DEB.SURY.ORG`` Automatic Signing Key <[email protected] >
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`` bookworm InRelease: The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 ``DEB.SURY.ORG`` Automatic Signing Key <[email protected] >
W: Failed to fetch ``https://packages.sury.org/apache2/dists/bookworm/InRelease`` The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 ``DEB.SURY.ORG`` Automatic Signing Key <[email protected] >
W: Failed to fetch ``https://packages.sury.org/php/dists/bookworm/InRelease`` The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 ``DEB.SURY.ORG`` Automatic Signing Key <[email protected] >
W: Some index files failed to download. They have been ignored, or old ones used instead.
1 Like
sahsanu
February 7, 2026, 11:22am
12
But dd you dowload the new key?
curl -s https://packages.sury.org/php/apt.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/sury-keyring.gpg >/dev/null
3 Likes
skribe
February 7, 2026, 11:26am
13
Thank you very much. That worked for me.
4 Likes
nu01
February 7, 2026, 1:02pm
14
Seems I had not. Guess, I just did not realize it. May bad on that.
1 Like
Thanks guys, @sahsanu ‘s curl command and echo commands solve it, big kudos !!!
1 Like