Today I'm going to share a little trick that, despite being quite easy, is useful for saving disk space and avoiding annoying updates . I recently updated my system to use kernel 3.5.0-X, but my system still had older kernel versions, 3.2.0-X, installed. Every time the system prompted me to update, it was updating to the 3.2.0-X branch of the kernel, which I wasn't using.
I set about removing these previous versions . To do this, I first checked which ones I had installed on my system using the command:
sudo dpkg -l | grep linux-image
This command returns a list of installed kernels, which in my case was quite a lot for the 3.2.0-X branch, so I decided to remove all packages from this branch to avoid future updates I wouldn't use. To do this, I used the following command:
sudo apt-get remove --purge linux-image-X.X.X-X
The X's should be replaced with the version we want to delete; in my case, it looks like this:
sudo apt-get remove --purge linux-image-3.2.0-40-generic-pae
After carrying out this last operation, 113 MB of disk space was freed, when repeating it to eliminate all versions of this branch, it freed me 1GB. Hope you find this tip useful and help you save disk space.
Taken from humanOS.