We’re rewarding the question askers & reputations are being recalculated! Read more.
3 added 18 characters in body
source | link

Fair warning: You should only mess with kernels (removing as well as manually installing new ones) if there is a need for it (space constraints or problems with the current kernel). Figuratively the kernel is the heart of your system, elementary really can't live without it!

You can now check the list of installed kernels again with dpkg -l | grep linux-image-. If a line starts with rc this only means there is residual config files remaining (uses little to no space).

You should only mess with kernels (removing as well as manually installing new ones) if there is a need for it (space constraints or problems with the current kernel). Figuratively the kernel is the heart of your system, elementary really can't live without it!

You can now check the list of installed kernels again with dpkg -l | grep linux-image-

Fair warning: You should only mess with kernels (removing as well as manually installing new ones) if there is a need for it (space constraints or problems with the current kernel). Figuratively the kernel is the heart of your system, elementary really can't live without it!

You can now check the list of installed kernels again with dpkg -l | grep linux-image-. If a line starts with rc this only means there is residual config files remaining (uses little to no space).

2 added 2844 characters in body
source | link

How-to remove old kernels manually

You should only mess with kernels (removing as well as manually installing new ones) if there is a need for it (space constraints or problems with the current kernel). Figuratively the kernel is the heart of your system, elementary really can't live without it!

Lines starting with $ denote commands you have to input in terminal, the following text is example output from my machine.

First display the kernel you are currently using, you want to keep that:

$ uname -r
3.19.0-26-generic

Then list all currently installed kernels:

$ dpkg -l | grep linux-image-
ii  linux-image-3.13.0-62-generic               3.13.0-62.102                                                   amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-46-generic               3.16.0-46.62~14.04.1                                            amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-26-generic               3.19.0-26.28~14.04.1                                            amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.13.0-62-generic         3.13.0-62.102                                                   amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-46-generic         3.16.0-46.62~14.04.1                                            amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-26-generic         3.19.0-26.28~14.04.1                                            amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-generic-lts-vivid               3.19.0.26.13                                                    amd64        Generic Linux kernel image

This means there are currently three kernels installed. The last entry for linux-image-generic-lts-vivid is a meta package which does not use much disk space (from installing the Ubuntu Vivid kernel in Freya) and should not be removed.

You can now remove kernels you don't need anymore. Make sure to at least keep two kernels around, which should be the absolute minimum so you have at least one backup if the most recent kernel fails.

$ sudo apt-get autoremove linux-image-3.13.0-62-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-image-3.13.0-62-generic linux-image-extra-3.13.0-62-generic
0 to upgrade, 0 to newly install, 2 to remove and 0 not to upgrade.
After this operation, 194 MB disk space will be freed.
Do you want to continue? [Y/n] y
...

You can now check the list of installed kernels again with dpkg -l | grep linux-image-

Adapted from Ubuntu documentation wiki, written by its contributors (cc-by-sa 3.0).

How-to remove old kernels manually

You should only mess with kernels (removing as well as manually installing new ones) if there is a need for it (space constraints or problems with the current kernel). Figuratively the kernel is the heart of your system, elementary really can't live without it!

Lines starting with $ denote commands you have to input in terminal, the following text is example output from my machine.

First display the kernel you are currently using, you want to keep that:

$ uname -r
3.19.0-26-generic

Then list all currently installed kernels:

$ dpkg -l | grep linux-image-
ii  linux-image-3.13.0-62-generic               3.13.0-62.102                                                   amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-46-generic               3.16.0-46.62~14.04.1                                            amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-26-generic               3.19.0-26.28~14.04.1                                            amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.13.0-62-generic         3.13.0-62.102                                                   amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-46-generic         3.16.0-46.62~14.04.1                                            amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-26-generic         3.19.0-26.28~14.04.1                                            amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-generic-lts-vivid               3.19.0.26.13                                                    amd64        Generic Linux kernel image

This means there are currently three kernels installed. The last entry for linux-image-generic-lts-vivid is a meta package which does not use much disk space (from installing the Ubuntu Vivid kernel in Freya) and should not be removed.

You can now remove kernels you don't need anymore. Make sure to at least keep two kernels around, which should be the absolute minimum so you have at least one backup if the most recent kernel fails.

$ sudo apt-get autoremove linux-image-3.13.0-62-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-image-3.13.0-62-generic linux-image-extra-3.13.0-62-generic
0 to upgrade, 0 to newly install, 2 to remove and 0 not to upgrade.
After this operation, 194 MB disk space will be freed.
Do you want to continue? [Y/n] y
...

You can now check the list of installed kernels again with dpkg -l | grep linux-image-

Adapted from Ubuntu documentation wiki, written by its contributors (cc-by-sa 3.0).

1
source | link

apt-get autoremove does not remove old kernels (by design). If you want to free up some space by removing old kernels you have to do this manually, but it's advised that the latest two kernel versions remain.