However, it requires a graphical user interface. I am more interested in removing the old Linux kernel images using command line tools only, as sometimes, I simply do not have the luxury of running a GUI. However, the discussion above indeed a good guide. I simply follow the steps below,
Find the versions of Linux kernel images and their packages.
You may first list the content of the /boot directory, which gives you an idea what kernel images are installed. Then you can use dpkg to find out the package names. Here is an example,
userfoo@ubuntu:~$ dpkg -l | grep linux | grep 3.0
ii linux-image-3.0.0-12-generic 3.0.0-12.20 i386 Linux kernel image for version 3.0.0 on x86/x86_64
In the above, I am looking for "3.0" because I figured from listing the content of the /boot directory that I have a Linux image of version of 3.0.0 installed. The above tells me that the corresponding package of the Linux image is "linux-image-3.0.0-12-generic".
Remove the Linux image package.
I remove the above Linux image package using apt-get.
userfoo@ubuntu:~$ sudo apt-get remove linux-image-3.0.0-12-generic
Similar method can be applied to CentOS and Fedora Linux. You can accomplish it using yum alone.