Error when apt upgrade - "raspi-firmware"

Summary:
Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
1 not fully installed or removed.
Space needed: 0 B / 113 GB available

Continue? [Y/n] y
Setting up raspi-firmware (1:1.20260513-1) …
/var/lib/dpkg/info/raspi-firmware.postinst: 48: /etc/kernel/postinst.d/z50-raspi-firmware: not found
dpkg: error processing package raspi-firmware (–configure):
installed raspi-firmware package post-installation script subprocess returned error exit status 127
Processing triggers for initramfs-tools (0.148.4+rpt1) …
update-initramfs: Generating /boot/initrd.img-6.12.87-v8-16k+
Errors were encountered while processing:
raspi-firmware
Error: Sub-process /usr/bin/dpkg returned an error code (1)

  • sudo apt purge raspi-firmware

Solved the issue