Ubuntu删除多余内核的方法
第一步:查看当前内核
rew$uname-a Linuxrew4.15.0-42-generic#45~16.04.1-UbuntuSMPMonNov1913:02:27UTC2018x86_64x86_64x86_64GNU/Linux
当前使用版本为:4.15.0-42-generic
第二步:查看所有内核
rew$dpkg--get-selections|greplinux console-setup-linuxinstall libselinux1:amd64install libselinux1:i386install linux-baseinstall linux-firmwareinstall linux-generic-hwe-16.04install linux-headers-4.15.0-42install linux-headers-4.15.0-39install linux-headers-4.15.0-39-genericinstall linux-headers-4.15.0-42-genericinstall linux-headers-generic-hwe-16.04install linux-image-4.15.0-39-genericinstall linux-image-4.15.0-42-genericinstall linux-image-generic-hwe-16.04install linux-libc-dev:amd64install linux-libc-dev:i386install linux-modules-4.15.0-39-genericinstall linux-modules-4.15.0-42-genericinstall linux-modules-extra-4.15.0-39-genericinstall linux-modules-extra-4.15.0-42-genericinstall linux-sound-baseinstall pptp-linuxinstall syslinuxinstall syslinux-commoninstall syslinux-legacyinstall util-linuxinstall
第三步:移除冗余内核
所有39版本的对我来说都是多余的,进行删除:
rew$sudoapt-getremove\ linux-headers-4.15.0-39\ linux-headers-4.15.0-39-generic\ linux-image-4.15.0-39-generic\ linux-modules-4.15.0-39-generic\ linux-modules-extra-4.15.0-39-generic
卸载后重新检查:
rew$dpkg--get-selections|greplinux console-setup-linuxinstall libselinux1:amd64install libselinux1:i386install linux-baseinstall linux-firmwareinstall linux-generic-hwe-16.04install linux-headers-4.15.0-42install linux-headers-4.15.0-42-genericinstall linux-headers-generic-hwe-16.04install linux-image-4.15.0-39-genericdeinstall linux-image-4.15.0-42-genericinstall linux-image-generic-hwe-16.04install linux-libc-dev:amd64install linux-libc-dev:i386install linux-modules-4.15.0-39-genericdeinstall linux-modules-4.15.0-42-genericinstall linux-modules-extra-4.15.0-39-genericdeinstall linux-modules-extra-4.15.0-42-genericinstall linux-sound-baseinstall pptp-linuxinstall syslinuxinstall syslinux-commoninstall syslinux-legacyinstall util-linuxinstall
状态为deinstall即已经卸载,如果觉得看着不舒服的话可以使用purge连配置文件里一起彻底删除,清理内核列表
rew$sudoapt-getpurge\ linux-headers-4.15.0-39\ linux-headers-4.15.0-39-generic\ linux-image-4.15.0-39-generic\ linux-modules-4.15.0-39-generic\ linux-modules-extra-4.15.0-39-generic
第四步:更新系统引导
删除内核后需要更新grub移除失效的启动项
rew$sudoupdate-grub#根据情况选择grub/grub2
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持毛票票。