Error on update the instance

What type of hardware are you using: Raspberry Pi 3, 4+
What YunoHost version are you running: 12.1.39
How are you able to access your server: The webadmin
SSH

Describe your issue

Hello,
When I try to update my instance, some errors occur and I have no idea how to fix it. Please, can you help me.

Share relevant logs or error messages

yunohost tools update =>
Info: Fetching available upgrades for system packages…
Warning: can’t create /var/cache/apt-show-versions/files: No such file or directory at /usr/bin/apt-show-versions line 197.
Warning: E: Problem executing scripts APT::Update::Post-Invoke-Success ‘test -x /usr/bin/apt-show-versions || exit 0 ; apt-show-versions -i’
Warning: E: Sub-process returned an error code
Info: The operation ‘Fetching available system updates and refreshing app catalog’ could not be completed. Please share the full log of this operation using the command ‘yunohost log share 20260112-215353-tools_update’ to get help
Error: Unable to update the cache of APT (Debian’s package manager). Here is a dump of the sources.list lines, which might help identify problematic lines:
sources.list:deb Index of /debian bookworm main contrib non-free non-free-firmware
sources.list:deb Index of /debian-security bookworm-security main contrib non-free non-free-firmware
sources.list:deb Index of /debian bookworm-updates main contrib non-free non-free-firmware
sources.list.d/extra_php_version.list:deb Index of /php/ bookworm main
sources.list.d/yunohost.list:deb [signed-by=/usr/share/keyrings/yunohost-bookworm.gpg] Index of /debian/ bookworm stable
sources.list.d/raspi.list:deb Index of /debian bookworm main
sources.list.d/yarn.list:deb [signed-by=/etc/apt/trusted.gpg.d/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main

What is the output of sudo apt update ?

Thank you for your help! The output of the command

sudo apt update
Hit:1 http://deb.debian.org/debian bookworm InRelease
Get:2 http://security.debian.org/debian-security bookworm-security InRelease [48.0 kB]                          
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]                                         
Hit:5 http://archive.raspberrypi.org/debian bookworm InRelease                                                  
Get:6 https://dl.yarnpkg.com/debian stable InRelease                                                            
Hit:7 https://packages.sury.org/php bookworm InRelease                                                 
Err:6 https://dl.yarnpkg.com/debian stable InRelease                               
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
Hit:4 https://forge.yunohost.org/debian bookworm InRelease
Reading package lists... Done                                                                                   
W: http://deb.debian.org/debian/dists/bookworm/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/yarn.gpg are ignored as the file has an unsupported filetype.
W: http://security.debian.org/debian-security/dists/bookworm-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/yarn.gpg are ignored as the file has an unsupported filetype.
W: http://deb.debian.org/debian/dists/bookworm-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/yarn.gpg are ignored as the file has an unsupported filetype.
W: http://archive.raspberrypi.org/debian/dists/bookworm/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/yarn.gpg are ignored as the file has an unsupported filetype.
W: GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
E: The repository 'https://dl.yarnpkg.com/debian stable 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: https://packages.sury.org/php/dists/bookworm/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/yarn.gpg are ignored as the file has an unsupported filetype.

I would like to bring some precisions that can help for fixing my issue. Initially I had some troubles with the free space. So I did some cleanup to free space. I run these commands

sudo apt clean
sudo apt autoclean
sudo rm -rf /var/cache/*
sudo journalctl --vacuum-size=200M
sudo find /var/log -type f -name "*.log" -exec truncate -s 0 {} \;

The cleanup was to deep unfortunatly… It generates the error on update and an error to connect to the user web interface (other post) :

And finally, this morning I received this email from the server :œ


/etc/cron.daily/yunohost-fetch-apps-catalog:
WARNING Failed to check pre-upgrade notifications for cockpit : [Errno 2] No such file or directory: '/var/cache/yunohost/app_tmp_work_dirs/app_whuxcmy9'
WARNING Failed to check pre-upgrade notifications for nextcloud : [Errno 2] No such file or directory: '/var/cache/yunohost/app_tmp_work_dirs/app_vh_jsdue'

Thanks a lot for your help!

Problem
APT fails because the Yarn GPG key is invalid / ignored (unsupported filetype), so the Yarn repo cannot be verified (NO_PUBKEY).

Fix (official Yarn method)

# Remove the broken key file
sudo rm -f /etc/apt/trusted.gpg.d/yarn.gpg

# Create keyrings directory if it doesn't exist
sudo mkdir -p /etc/apt/keyrings

# Add Yarn official key and repo
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /etc/apt/keyrings/yarn-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

# Update
sudo apt update

Source (official documentation):
https://classic.yarnpkg.com/lang/en/docs/install/#debian-stable