如何删除旧内核?

如何删除旧内核?

我尝试删除旧内核。我在 Ubuntu 18.04 LTS 上:这是安装的内核:

admin@sintrones-abox:/usr/src$ sudo dpkg --list | egrep 'linux-image|linux-headers'
ii  linux-headers-4.15.0-189                4.15.0-189.200                            all          Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-189-generic        4.15.0-189.200                            amd64        Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-headers-5.4.0-122-generic         5.4.0-122.138~18.04.1                     amd64        Linux kernel headers for version 5.4.0 on 64 bit x86 SMP
ii  linux-headers-generic                   4.15.0.189.174                            amd64        Generic Linux kernel headers
ii  linux-image-5.4.0-122-generic           5.4.0-122.138~18.04.1                     amd64        Signed kernel image generic
ii  linux-image-unsigned-4.15.0-189-generic 4.15.0-189.200      

使用的是:

admin@sintrones-abox:/usr/src$ uname -r
5.4.0-122-generic

我尝试过:

admin@sintrones-abox:/usr/src$ sudo apt autoremove --purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  amd64-microcode* intel-microcode* iucode-tool* libdbus-glib-1-2* linux-headers-generic-hwe-18.04-edge* thermald*
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
After this operation, 6,962 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 109262 files and directories currently installed.)
Removing amd64-microcode (3.20191021.1+really3.20181128.1~ubuntu0.18.04.1) ...
update-initramfs: deferring update (trigger activated)
Removing intel-microcode (3.20220510.0ubuntu0.18.04.1) ...
update-initramfs: deferring update (trigger activated)
Removing iucode-tool (2.3.1-1) ...
Removing thermald (1.7.0-5ubuntu5) ...
Removing libdbus-glib-1-2:amd64 (0.110-2) ...
Removing linux-headers-generic-hwe-18.04-edge (5.4.0.122.138~18.04.102) ...
Processing triggers for libc-bin (2.27-3ubuntu1.6) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for dbus (1.12.2-1ubuntu1.3) ...
Processing triggers for initramfs-tools (0.130ubuntu3.13) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-122-generic
W: Possible missing firmware /lib/firmware/i915/tgl_dmc_ver2_04.bin for module i915
W: Possible missing firmware /lib/firmware/i915/skl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/glk_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/icl_guc_33.0.0.bin for module i915
(Reading database ... 109110 files and directories currently installed.)
Purging configuration files for intel-microcode (3.20220510.0ubuntu0.18.04.1) ...
update-initramfs: deferring update (trigger activated)
Purging configuration files for thermald (1.7.0-5ubuntu5) ...
Purging configuration files for amd64-microcode (3.20191021.1+really3.20181128.1~ubuntu0.18.04.1) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for dbus (1.12.2-1ubuntu1.3) ...
Processing triggers for initramfs-tools (0.130ubuntu3.13) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-122-generic
W: Possible missing firmware /lib/firmware/i915/tgl_dmc_ver2_04.bin for module i915
W: Possible missing firmware /lib/firmware/i915/skl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/glk_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/icl_guc_33.0.0.bin for module i915

并且该/usr/src文件夹仍然包含所有内核目录:

admin@sintrones-abox:/usr/src$ ls
backport-iwlwifi-8324     linux-headers-4.15.0-189-generic  linux-hwe-5.4-headers-5.4.0-122  linux-source-4.15.0.tar.bz2
linux-headers-4.15.0-189  linux-headers-5.4.0-122-generic   linux-source-4.15.0

相关内容