如何从系统中删除内核 3.5.0-36

如何从系统中删除内核 3.5.0-36

我可以在启动项中看到 3.5.0-36 的条目。但是,我无法将其删除,因为没有要删除的包。

有关更多详细信息,请参阅下面的命令输出。

1)命令:

sudo update-grub2

输出 :

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-75-generic
Found initrd image: /boot/initrd.img-4.4.0-75-generic
Found linux image: /boot/vmlinuz-4.4.0-72-generic
Found initrd image: /boot/initrd.img-4.4.0-72-generic
Found linux image: /boot/vmlinuz-3.5.0-36-generic
Found initrd image: /boot/initrd.img-3.5.0-36-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done

2)命令:

dpkg -l | grep 'linux-image'

输出 :

ii  linux-image-4.4.0-72-generic                    4.4.0-72.93        amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-75-generic                    4.4.0-75.96        amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-72-generic              4.4.0-72.93        amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-75-generic              4.4.0-75.96        amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-generic                             4.4.0.75.81        amd64        Generic Linux kernel image

3)命令:

uname -a ; lsb_release -a

输出 :

Linux manish-Vostro-3446 4.4.0-75-generic #96-Ubuntu SMP Thu Apr 20 09:56:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:    16.04
Codename:   xenial

答案1

  1. 验证文件是否位于/boot

    ls -la /boot |grep '3\.5'
    
  2. 删除文件。注意空格。此命令将在删除每个文件之前提示

    sudo rm -i /boot/*-3.5.0-36*
    
  3. 更新启动菜单

    sudo update-grub2
    

相关内容