我已经尝试过/boot 已满 100%,apt-get purge linux-image-xxxx-generic 不起作用但没有帮助。
根本原因似乎是 apt/purge-old-kernels 不再识别旧内核
sudo apt autoclean && sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run ‘apt-get -f install’ to correct these.
The following packages have unmet dependencies.
linux-image-extra-4.4.0-78-generic : Depends: linux-image-4.4.0-78-generic but it is not installed
linux-image-generic : Depends: linux-image-4.4.0-78-generic but it is not installed
E: Unmet dependencies. Try using -f.
uname -a
Linux host 4.4.0-75-generic #96-Ubuntu SMP Thu Apr 20 09:56:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
sudo 清除旧内核
No kernels are eligible for removal
sudo apt-get purge linux-image-4.4.0-7
linux-image-4.4.0-71-generic linux-image-4.4.0-75-generic linux-image-4.4.0-77-generic
sudo apt-get purge linux-image-4.4.0-71-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
linux-image-extra-4.4.0-71-generic : Depends: linux-image-4.4.0-71-generic but it is not going to be installed
linux-image-extra-4.4.0-78-generic : Depends: linux-image-4.4.0-78-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-4.4.0-78-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
sudo apt-get -f purge linux-image-4.4.0-71-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
linux-image-extra-4.4.0-71-generic : Depends: linux-image-4.4.0-71-generic but it is not going to be installed
linux-image-extra-4.4.0-78-generic : Depends: linux-image-4.4.0-78-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-4.4.0-78-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
但内容依然是:
/boot dir
total 459M
drwxr-xr-x 4 root root 4,0K Mai 19 07:31 .
drwxr-xr-x 27 root root 4,0K Mai 8 18:34 ..
-rw-r--r-- 1 root root 1,2M Jul 13 2016 abi-4.4.0-31-generic
-rw-r--r-- 1 root root 1,2M Okt 27 2016 abi-4.4.0-47-generic
-rw-r--r-- 1 root root 1,2M Feb 1 20:39 abi-4.4.0-63-generic
-rw-r--r-- 1 root root 1,2M Mär 22 17:11 abi-4.4.0-70-generic
-rw-r--r-- 1 root root 1,2M Mär 24 16:20 abi-4.4.0-71-generic
-rw-r--r-- 1 root root 1,2M Apr 20 14:02 abi-4.4.0-75-generic
-rw-r--r-- 1 root root 186K Jul 13 2016 config-4.4.0-31-generic
-rw-r--r-- 1 root root 186K Okt 27 2016 config-4.4.0-47-generic
-rw-r--r-- 1 root root 186K Feb 1 20:39 config-4.4.0-63-generic
-rw-r--r-- 1 root root 186K Mär 22 17:11 config-4.4.0-70-generic
-rw-r--r-- 1 root root 186K Mär 24 16:20 config-4.4.0-71-generic
-rw-r--r-- 1 root root 186K Apr 20 14:02 config-4.4.0-75-generic
-rw-r--r-- 1 root root 57K Dez 11 10:45 glxinfo.log
drwxr-xr-x 5 root root 1,0K Mai 8 18:35 grub
-rw-r--r-- 1 root root 38M Nov 11 2016 initrd.img-4.4.0-31-generic
-rw-r--r-- 1 root root 39M Dez 27 18:15 initrd.img-4.4.0-47-generic
-rw-r--r-- 1 root root 39M Dez 27 18:14 initrd.img-4.4.0-53-generic
-rw-r--r-- 1 root root 39M Feb 10 02:53 initrd.img-4.4.0-59-generic
-rw-r--r-- 1 root root 39M Feb 12 10:17 initrd.img-4.4.0-62-generic
-rw-r--r-- 1 root root 39M Feb 21 00:12 initrd.img-4.4.0-63-generic
-rw-r--r-- 1 root root 39M Mär 28 06:45 initrd.img-4.4.0-70-generic
-rw-r--r-- 1 root root 39M Mär 30 08:32 initrd.img-4.4.0-71-generic
-rw-r--r-- 1 root root 39M Mai 8 18:35 initrd.img-4.4.0-75-generic
-rw-r--r-- 1 root root 39M Mai 8 18:35 initrd.img-4.4.0-77-generic
-rw-r--r-- 1 root root 4,0K Dez 11 10:48 inxi.log
drwx------ 2 root root 12K Nov 11 2016 lost+found
-rw-r--r-- 1 root root 179K Jän 28 2016 memtest86+.bin
-rw-r--r-- 1 root root 181K Jän 28 2016 memtest86+.elf
-rw-r--r-- 1 root root 181K Jän 28 2016 memtest86+_multiboot.bin
-rw------- 1 root root 3,7M Jul 13 2016 System.map-4.4.0-31-generic
-rw------- 1 root root 3,7M Okt 27 2016 System.map-4.4.0-47-generic
-rw------- 1 root root 3,8M Feb 1 20:39 System.map-4.4.0-63-generic
-rw------- 1 root root 3,8M Mär 22 17:11 System.map-4.4.0-70-generic
-rw------- 1 root root 3,8M Mär 24 16:20 System.map-4.4.0-71-generic
-rw------- 1 root root 3,8M Apr 20 14:02 System.map-4.4.0-75-generic
-rw-r--r-- 1 root root 6,8M Nov 11 2016 vmlinuz-4.4.0-31-generic
-rw------- 1 root root 6,8M Okt 27 2016 vmlinuz-4.4.0-47-generic
-rw------- 1 root root 6,8M Feb 1 20:39 vmlinuz-4.4.0-63-generic
-rw------- 1 root root 6,8M Mär 22 17:11 vmlinuz-4.4.0-70-generic
-rw------- 1 root root 6,8M Mär 24 16:20 vmlinuz-4.4.0-71-generic
-rw------- 1 root root 6,8M Apr 20 14:02 vmlinuz-4.4.0-75-generic
-rw-r--r-- 1 root root 54K Dez 11 10:44 Xorg.0.log
我发现了一个相当肮脏的解决方法现在通过“mv”手动将旧内核移动到另一个文件夹。
所以我的问题是:如何防止这种情况再次发生?如何修复无法识别的其他内核版本(如 4.4.0-31)?
更新:
apt-cache 搜索 linux-image | cut -f 1 -d ' ' | xargs dpkg -l 2>&1 | grep ^ii
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-4.4.0-77-generic 4.4.0-77.98 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-78-generic 4.4.0-78.99 amd64 Linux kernel image 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-extra-4.4.0-77-generic 4.4.0-77.98 amd64 Linux kernel extra modules for version 4.4.0 odpkg-query: no packages found matching linux-image-4.4.0-21-generic
ii linux-image-extra-4.4.0-78-generic 4.4.0-78.99 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-generic 4.4.0.78.84 amd64 Generic Linux kernel image
目录 /boot/
total 359M
drwxr-xr-x 4 root root 4,0K Mai 19 07:50 .
drwxr-xr-x 27 root root 4,0K Mai 19 07:41 ..
-rw-r--r-- 1 root root 1,2M Feb 1 20:39 abi-4.4.0-63-generic
-rw-r--r-- 1 root root 1,2M Mär 22 17:11 abi-4.4.0-70-generic
-rw-r--r-- 1 root root 1,2M Apr 20 14:02 abi-4.4.0-75-generic
-rw-r--r-- 1 root root 1,2M Apr 27 20:24 abi-4.4.0-78-generic
-rw-r--r-- 1 root root 186K Feb 1 20:39 config-4.4.0-63-generic
-rw-r--r-- 1 root root 186K Mär 22 17:11 config-4.4.0-70-generic
-rw-r--r-- 1 root root 186K Apr 20 14:02 config-4.4.0-75-generic
-rw-r--r-- 1 root root 186K Apr 27 20:24 config-4.4.0-78-generic
-rw-r--r-- 1 root root 57K Dez 11 10:45 glxinfo.log
drwxr-xr-x 5 root root 1,0K Mai 19 17:35 grub
-rw-r--r-- 1 root root 39M Dez 27 18:14 initrd.img-4.4.0-53-generic
-rw-r--r-- 1 root root 39M Feb 10 02:53 initrd.img-4.4.0-59-generic
-rw-r--r-- 1 root root 39M Feb 12 10:17 initrd.img-4.4.0-62-generic
-rw-r--r-- 1 root root 39M Feb 21 00:12 initrd.img-4.4.0-63-generic
-rw-r--r-- 1 root root 39M Mär 28 06:45 initrd.img-4.4.0-70-generic
-rw-r--r-- 1 root root 39M Mai 19 07:47 initrd.img-4.4.0-75-generic
-rw-r--r-- 1 root root 39M Mai 19 07:47 initrd.img-4.4.0-77-generic
-rw-r--r-- 1 root root 39M Mai 19 07:47 initrd.img-4.4.0-78-generic
-rw-r--r-- 1 root root 4,0K Dez 11 10:48 inxi.log
drwx------ 2 root root 12K Nov 11 2016 lost+found
-rw-r--r-- 1 root root 179K Jän 28 2016 memtest86+.bin
-rw-r--r-- 1 root root 181K Jän 28 2016 memtest86+.elf
-rw-r--r-- 1 root root 181K Jän 28 2016 memtest86+_multiboot.bin
-rw------- 1 root root 3,8M Feb 1 20:39 System.map-4.4.0-63-generic
-rw------- 1 root root 3,8M Mär 22 17:11 System.map-4.4.0-70-generic
-rw------- 1 root root 3,8M Apr 20 14:02 System.map-4.4.0-75-generic
-rw------- 1 root root 3,8M Apr 27 20:24 System.map-4.4.0-78-generic
-rw------- 1 root root 6,8M Feb 1 20:39 vmlinuz-4.4.0-63-generic
-rw------- 1 root root 6,8M Mär 22 17:11 vmlinuz-4.4.0-70-generic
-rw------- 1 root root 6,8M Apr 20 14:02 vmlinuz-4.4.0-75-generic
-rw------- 1 root root 6,8M Apr 27 20:24 vmlinuz-4.4.0-78-generic
-rw-r--r-- 1 root root 54K Dez 11 10:44 Xorg.0.log
这是否意味着我可以手动删除 dpkg 未找到的版本?
谢谢!