apt-get error during updating DietPi

Yes, I will re-setup the system using a SSD.

It might be just a small benefit next to all the trouble you have. But the new install would be Debian Bullseye, while your current one was still Buster. :wink:

We could try to manually replace the corrupted library files, but no guarantee that this will work if the SD card has bad blocks/is dying and we don’t know whether more files are affected. So cleaner would be indeed a fresh image, it that doesn’t cause too much work.

Is there a manual how to install a bootable DietPi on a SSD for Raspberry Pi 3? I couldn’t find anything.

simply flash you image directly into the SSD, similar to how you would do it on a SD card. Keep in mind, all data on the SSD will be removed.

Depending on the exact model, mass storage boot might need to be enabled as well. https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#usb-mass-storage-boot

In case, not all flashing tools list 2.5" USB drives. If you do from Windows, Rufus has an option to show and select them.