Kodi does not let upgrade

Hello,

on a RPi3 with the current DietPi version (v8.23.3) (bookworm) I cannot upgrade to the latest Kodi version.

The error messages look like this, but in German language…

root@kodi:~# sudo apt-get upgrade
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Paketaktualisierung (Upgrade) wird berechnet… Fertig
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
  kodi-data libcrossguid0 libcurl3-gnutls libdate-tz3 libfmt9 libfontenc1 libgl1 libglx-mesa0 libglx0 libice6 libjs-iscroll libjs-jquery libkissfft-float131 libsm6 libsndio7.0
  libspdlog1.10 libva-wayland2 libxaw7 libxcb-glx0 libxcb-shape0 libxcomposite1 libxft2 libxi6 libxinerama1 libxkbfile1 libxmu6 libxmuu1 libxpm4 libxt6 libxtst6 libxv1 libxxf86dga1
  libxxf86vm1 mesa-utils mesa-utils-bin python3-pycryptodome x11-common x11-utils
Verwenden Sie »sudo apt autoremove«, um sie zu entfernen.
Die folgenden Pakete werden aktualisiert (Upgrade):
  kodi kodi-bin
2 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
12 nicht vollständig installiert oder entfernt.
Es müssen noch 0 B von 37,4 MB an Archiven heruntergeladen werden.
Nach dieser Operation werden 54,1 MB Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n] j
(Lese Datenbank ... 28157 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../kodi_3%3a20.2-2~bookworm_all.deb ...
Entpacken von kodi (3:20.2-2~bookworm) über (2:20.1+dfsg-1) ...
dpkg: Fehler beim Bearbeiten des Archivs /var/cache/apt/archives/kodi_3%3a20.2-2~bookworm_all.deb (--unpack):
 Versuch, »/usr/lib/firewalld/services/kodi-eventserver.xml« zu überschreiben, welches auch in Paket kodi-data 2:20.1+dfsg-1 ist
dpkg-deb: Fehler: »einfügen«-Unterprozess wurde durch Signal (Datenübergabe unterbrochen (broken pipe)) getötet
Vorbereitung zum Entpacken von .../kodi-bin_3%3a20.2-2~bookworm_arm64.deb ...
Entpacken von kodi-bin (3:20.2-2~bookworm) über (2:20.1+dfsg-1) ...
dpkg: Fehler beim Bearbeiten des Archivs /var/cache/apt/archives/kodi-bin_3%3a20.2-2~bookworm_arm64.deb (--unpack):
 Versuch, »/usr/bin/kodi« zu überschreiben, welches auch in Paket kodi 2:20.1+dfsg-1 ist
dpkg-deb: Fehler: »einfügen«-Unterprozess wurde durch Signal (Datenübergabe unterbrochen (broken pipe)) getötet
Fehler traten auf beim Bearbeiten von:
 /var/cache/apt/archives/kodi_3%3a20.2-2~bookworm_all.deb
 /var/cache/apt/archives/kodi-bin_3%3a20.2-2~bookworm_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Is there perhaps a solution approach?

Best regards,
Carsten

A short search within our forum should give a possible solution 8.23.3 Fail Update on RPI4

@Joulinar

Yes, the thing with the search…Sorry…

But unfortunately the hint with reinstall kodi did not work. Several attempts failed. Now I did a complete reinstall of DietPi and face the same problem as after the attempts with reinstall kodi.
The installation of kodi does not finish completely.

Console output:

Setting up kodi (3:20.2-2~bookworm) ...
dpkg: error processing package kodi (--configure):
 installed kodi package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 kodi
E: Sub-process /usr/bin/dpkg returned an error code (1)
[FAILED] DietPi-Software | APT install kodi libgl1-mesa-dri
 - Command: apt-get -y --allow-change-held-packages install kodi libgl1-mesa-dri
[ INFO ] DietPi-Software | APT install kodi libgl1-mesa-dri, please wait...
Reading package lists...
Building dependency tree...
Reading state information...
kodi is already the newest version (3:20.2-2~bookworm).
                                                       libgl1-mesa-dri is already the newest version (23.2.1-0+rpt2).
                                                                                                                     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
                                                                                                                                                                                   1 not fully installed or removed.
                             After this operation, 0 B of additional disk space will be used.
                                                                                             Setting up kodi (3:20.2-2~bookworm) ...
dpkg: error processing package kodi (--configure):
 installed kodi package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 kodi
E: Sub-process /usr/bin/dpkg returned an error code (1)
[FAILED] DietPi-Software | APT install kodi libgl1-mesa-dri
 - Command: apt-get -y --allow-change-held-packages install kodi libgl1-mesa-dri
[ INFO ] DietPi-Software | Executing alternative command: apt-get -y --allow-change-held-packages install kodi libgl1-mesa-dri
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
kodi is already the newest version (3:20.2-2~bookworm).
libgl1-mesa-dri is already the newest version (23.2.1-0+rpt2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up kodi (3:20.2-2~bookworm) ...
dpkg: error processing package kodi (--configure):
 installed kodi package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 kodi
E: Sub-process /usr/bin/dpkg returned an error code (1)
[FAILED] Alternative command execution | Exited with error
Press any key to return to error handler menu...

What can be the cause that kodi does not install completely? Under bullseye everything worked fine with 100% same hardware.

there was one issue in addition within the post I linked 8.23.3 Fail Update on RPI4 - #5 by Joulinar

Thanks, the workaround from MichaIng worked for me.