Unable to update older DietPi installation

Hi -

I have DietPi running on an older Pi3 board which, because it does exactly what I need it to rarely gets checked.

I recently logged in and was unsurprised to find that it was letting me know there was an update available (from 6.34.3 to 6.35.0), so I duly ran dietpi-update.

However (possibly as a consequence of the amount of time I’ve waited to do this) the process reaches a point and then fails with the following:-

APT upgrade                                                                  │
│  - Command: apt-get -qq upgrade                                              │
│  - Exit code: 100                                                            │
│  - DietPi version: v6.34.3 (MichaIng/master) | HW_MODEL: 3 | HW_ARCH: 2 |    │
│ DISTRO: 4                                                                    │
│  - Image creator: DietPi Core Team                                           │
│  - Pre-image: Raspbian Lite                                                  │
│  - Error log:                                                                │
│ E: Failed to fetch                                                           │
│ https://packages.sury.org/php/pool/main/p/php-defaults/php-common_81+0~20210 │
│ 223.34+debian9~1.gbpf52eb0_all.deb  404  Not Found                           │
│ E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing

When I tried the --fix-missing option it returned this -

Hit:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:2 https://archive.raspberrypi.org/debian stretch InRelease
Err:3 https://packages.sury.org/php stretch InRelease
  The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key <deb@sury.org>
Reading package lists... Done
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 <deb@sury.org>
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 <deb@sury.org>
W: Some index files failed to download. They have been ignored, or old ones used instead.

I attempted the dietpi-update again but this resulted in the same outcome.

Can anyone advise if there’s anything I can do manually to get me past this little bump.

Many Thanks.
Phil.

I had this same error a few months back.

Take the following with a grain of salt, as this may not be the most appropriate method to deal with the problem. For that reason, you may want to wait for a more authorative answer. This is simply what I did to the best of my recollection and a best effort to re-trace my steps.

FYI, the source for the following steps. Note that the steps below come from the comment section, not the OP. If the following doesn’t work for you, there are several suggestions on that same page you might try.


From your terminal, the first thing to do is delete the expired key:

apt-key del B188E2B695BD4743

Then we need to grab the new key and write it into the appropriate file:

curl -sSL -o /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

Note: the options are for ‘silent’, ‘Show errors’, ‘Location/follow redirects’, and ‘output to file’.

The instructions then call for an apt update, but I don’t think that is required in our case here.

Then you should be able to do the update.

Basically follow the following. it’s a known issue in old installation

apt-key del '95BD4743' # delete the old key
curl -sSfL 'https://packages.sury.org/php/apt.gpg' -o /etc/apt/trusted.gpg.d/dietpi-php.gpg # download the new key
/boot/dietpi/func/dietpi-set_software apt-cache clean # clean the apt cache
apt update # update again the package cache

https://github.com/MichaIng/DietPi/issues/4219#issue-840055898

As well consider to update to Buster as you are running oldold Debian Stretch.

Thanks both of you.

As well consider to update to Buster as you are running oldold Debian Stretch

I assumed if I went through the updates that this would eventually upgrade. I was going to run dietpi-update until it informed me there were no further updates and then do an apt dist-upgrade.

DietPi update will never force a Destro upgrade. This always would need to be done by the admin themselves.

https://dietpi.com/docs/usage/#how-to-upgrade-to-buster