Can't update DietPi ("failed to fetch...")

How can I fix this error when running dietpi-update:

- 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: Failed to fetch
│ https://packages.sury.org/php/pool/main/p/php7.4/php7.4-json_7.4.16-1+0~2021
│ 0305.42+debian9~1.gbpbbe65e_armhf.deb  404  Not Found
│ E: Failed to fetch
│ https://packages.sury.org/php/pool/main/p/php7.4/php7.4-opcache_7.4.16-1+0~2
│ 0210305.42+debian9~1.gbpbbe65e_armhf.deb  404  Not Found
│ E: Failed to fetch
│ https://packages.sury.org/php/pool/main/p/php7.4/php7.4-readline_7.4.16-1+0~
│ 20210305.42+debian9~1.gbpbbe65e_armhf.deb  404  Not Found
│ E: Failed to fetch
│ https://packages.sury.org/php/pool/main/p/php7.4/php7.4-cli_7.4.16-1+0~20210

I went to, for example, https://packages.sury.org/php/pool/main/p/php7.4/, and there are no 7.4.16 files, only 7.4.18.

Hi,

you would need to update the PGP key for the PHP repository

https://github.com/MichaIng/DietPi/issues/4219

apt-key del '95BD4743'
curl -sSfL 'https://packages.sury.org/php/apt.gpg' -o /etc/apt/trusted.gpg.d/dietpi-php.gpg
/boot/dietpi/func/dietpi-set_software apt-cache clean
apt update
apt upgrade

Now the update is running, thanks!

Strange, that should have been done automatically via pre-patches, all but cleaning the cache, which should not be required :thinking:.

DonLiborio from which DietPi version did you update?

MichaIng
we had a couple of cases where apt-cache clean was needed to do the final step after PGP key renewal

From v6.34.3

Strange. apt-get clean only removes the cache file which is anyway rebuild with apt-get update + the updated list files contain newer package versions already. One of these assumptions is obviously wrong. I need to read into that for the future.

Most confusing is that G_AGUP itself runs apt-get clean as apt-get update can fall if the cache is malformed.

Ah Joulinar do you mean dietpi-set_software apt-cache clean? That also removes the pain text package list files, probably those get stuck somehow when apt-get update fails one time due to expired key.

MichaIng
correct, dietpi-set_software apt-cache clean is needed

Applied now: https://github.com/MichaIng/DietPi/commit/dfb1d9f5dd8e3eb24e760664fcf72d5340f7eaf4
Probably this is something we should add to the beta and current master branch directly as well? It’s not really a change to the DietPi code deployed on the system, but a change to the update server, if you want, as this file is pulled in a separate request. But at least once we had a user that complained master branch having a commit not being done to dev branch :wink:.

if this is not breaking thinks why not :sunglasses: