This related command would (should) work with, I think:
sudo dpkg -l | grep linux-image | grep ^rc
sudo dpkg -l | grep ^rc | awk '{print $2}' −− for all other obsolete packages.
Yet it cannot be “successful” while both current Linux kernels are in ii stage:
sudo dpkg -l | grep linux-image | grep ^ii
Anyway, below one would give result which one to delete manually, if preferred:
sudo dpkg -l | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p'
But still and before linux-image-5.16.0-1-librem5 purged, this test might be useful if some other packages related/depend on it:
sudo dpkg --purge --simulate linux-image-5.16.0-1-librem5 $(dpkg -l | grep ^rc | awk '{print $2}')