Pretty useful script that I found.

Was skeptical at first with it being last updated from 2019, but I investigated the code before running it on the server box this site and my other stuff is hosted on, and all it does is run dpkg -l, processes the output, and runs an apt --purge $kernels-to-remove.

I had 14 old kernels that needed removing. Which made this quick and easy.