How do I remove corrupt / invalid packages

I had that with a laptop that I did not update for a month or more. Could that be the case?

If so, this helped me

Don’t forget to sudo grub-install after the update worked but before rebooting to avoid the recent grub problem. Assuming you did not update for a while… Else you are going to be stuck in an unbootable system.