0

I have installed a wrong version of the kernel. I want delete it because it is also visible from the grub advanced option.

simone
  • 23
  • 1
    There is already an answer to a similar question here: http://askubuntu.com/questions/89710/how-do-i-free-up-more-space-in-boot/270960#270960 Does that help? – onyinyang Apr 17 '16 at 03:59

1 Answers1

2

Let's explain it by using an example ... boot with the kernel you want to keep, in this case kernel 4.2.0-35. To check which kernel versions currently are installed, open a terminal and execute :

dpkg --get-selections | grep linux  

The output in this example shows that kernels 4.2.0-34 and 4.2.0-35 are currently installed.

linux-firmware                          install  
linux-generic                           install  
linux-headers-4.2.0-34                  install  
linux-headers-4.2.0-35                  install
linux-headers-4.2.0-34-generic          install
linux-headers-4.2.0-35-generic          install  
linux-headers-generic                   install  
linux-image-4.2.0-34-generic            install  
linux-image-4.2.0-35-generic            install
linux-image-extra-4.2.0-34-generic      install
linux-image-extra-4.2.0-35-generic      install  
linux-image-generic                     install  
linux-libc-dev:amd64                    install  
linux-signed-generic                    install  
linux-signed-image-4.2.0-34-generic     install  
linux-signed-image-4.2.0-35-generic     install
linux-signed-image-generic              install  

Assuming that the older kernel 4.2.0-34 shall be removed - execute the following command :

sudo apt-get purge linux-headers-4.2.0-34 linux-headers-4.2.0-34-generic linux-image-4.2.0-34-generic linux-image-extra-4.2.0-34-generic linux-signed-image-4.2.0-34-generic

Done! :-)

cl-netbox
  • 31,163
  • 7
  • 94
  • 131
  • FYI: Unless you carefully address the above, you can end up deleting other critical things. As cl-netbox did here, they selectively found and specified the packages they want to delete - do NOT delete the entire list of results from the dpkg --get-selections blindly! – Thomas Ward Nov 11 '16 at 14:35
  • I had some challenges to run the command as installation of some kernels where not complete due to running out of space on /boot volume. The solution for me was to increase /boot size, then complete kernel installation by running "apt-get -f install" and than applying @cl-netbox recommendation. – Sergey Vlasov Jan 30 '20 at 02:07