This question already has an answer here:

After I install a new kernel and do sudo apt autoremove these two items related to the just-removed kernel always show up in synaptic under Not Installed (residual config).

enter image description here

What's the terminal command to get rid of these, so I don't have to open synaptic? Can I do it through aptitude?

marked as duplicate by muru, Thomas Ward Apr 24 '18 at 19:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.