2012
03.15
				
				
				
				03.15
Here’s a little snippet that I use to remove all the unused kernels on my Ubuntu servers/desktops. Unused means all the kernel that are currently not in use. For servers that don’t reboot so often that could mean removing kernels that are newer than uname -r. So make sure to pay attention…
dpkg -l | egrep '^ii  linux-(image|headers)-2' | awk '{print $2}' \
  | grep -v $(uname -r | sed 's/-generic//' | sed 's/-server//') \
  | xargs apt-get remove --purge -y \
;
					
				
I do not understand your instructions.
What don’t you understand?