Today I bring you a little trick, which despite being quite easy, is useful to save disk space and avoid annoying updates what do we need. I recently made an update of my system to use the 3.5.0-X kernel, but the previous versions of the 3.2.0-X kernel were installed on my system and every time the system asked to update, it was updating the 3.2.0 branch -X from the kernel, which I wasn't using.
I gave myself to the task of remove these older versions, for this, first I saw which ones were installed on my system, using the command:
sudo dpkg -l | grep linux-image
This command returns the list of installed kernels, which in my case were enough for the 3.2.0-X branch, so I decided to remove all the packages from this branch and thus avoid new updates that I would not use. To perform this action use the command:
sudo apt-get remove --purge linux-image-X.X.X-X
The Xs must be replaced by the version we want to remove, in my case it is as follows:
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 humans.