内核镜像太多

内核镜像太多

我从 Ubuntu 12.04 LTS 升级到了 14.04 LTS

当我尝试运行时sudo apt-get upgrade,我得到:

Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-33-generic /boot/vmlinuz-3.2.0-33-generic
update-initramfs: Deleting /boot/initrd.img-3.2.0-33-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-33-generic /boot/vmlinuz-3.2.0-33-generic
Generating grub configuration file ...
cat: /video.lst: No such file or directory
/usr/sbin/grub-probe: error: failed to get canonical path of `'.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 64
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.2.0-33-generic.postrm line 328.
dpkg: error processing package linux-image-3.2.0-33-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Removing linux-image-3.2.0-34-generic (3.2.0-34.53) ...

Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-34-generic /boot/vmlinuz-3.2.0-34-generic
update-initramfs: Deleting /boot/initrd.img-3.2.0-34-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-34-generic /boot/vmlinuz-3.2.0-34-generic
Generating grub configuration file ...
cat: /video.lst: No such file or directory
/usr/sbin/grub-probe: error: failed to get canonical path of `'.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 64
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.2.0-34-generic.postrm line 328.
dpkg: error processing package linux-image-3.2.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Removing linux-image-3.2.0-35-generic (3.2.0-35.55) ...

<snip>
<snip>
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-65-generic /boot/vmlinuz-3.2.0-65-generic
update-initramfs: Deleting /boot/initrd.img-3.2.0-65-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-65-generic /boot/vmlinuz-3.2.0-65-generic
Generating grub configuration file ...
cat: /video.lst: No such file or directory
/usr/sbin/grub-probe: error: failed to get canonical path of `'.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 64
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.2.0-65-generic.postrm line 328.
dpkg: error processing package linux-image-3.2.0-65-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 linux-image-3.2.0-26-generic
 linux-image-3.2.0-27-generic
 linux-image-3.2.0-29-generic
 linux-image-3.2.0-30-generic
 linux-image-3.2.0-31-generic
 linux-image-3.2.0-32-generic
 linux-image-3.2.0-33-generic
 linux-image-3.2.0-34-generic
 linux-image-3.2.0-35-generic
 linux-image-3.2.0-36-generic
 linux-image-3.2.0-37-generic
 linux-image-3.2.0-38-generic
 linux-image-3.2.0-39-generic
 linux-image-3.2.0-40-generic
 linux-image-3.2.0-41-generic
 linux-image-3.2.0-43-generic
 linux-image-3.2.0-44-generic
 linux-image-3.2.0-45-generic
 linux-image-3.2.0-48-generic
 linux-image-3.2.0-49-generic
 linux-image-3.2.0-51-generic
 linux-image-3.2.0-52-generic
 linux-image-3.2.0-53-generic
 linux-image-3.2.0-54-generic
 linux-image-3.2.0-55-generic
 linux-image-3.2.0-56-generic
 linux-image-3.2.0-57-generic
 linux-image-3.2.0-58-generic
 linux-image-3.2.0-59-generic
 linux-image-3.2.0-60-generic
 linux-image-3.2.0-61-generic
 linux-image-3.2.0-63-generic
 linux-image-3.2.0-64-generic
 linux-image-3.2.0-65-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
lcable@dell9150:/boot/grub>

我不知道哪里出了问题或者如何解决它。

答案1

“由于已达到 MaxReports,因此未写入 apport 报告” 是什么意思?正如您的消息标题所暗示的那样,这表明安装了太多旧内核。该帖子提供了几种删除旧内核的方法。另请参阅: 删除旧内核找到列出所有已安装内核的方法,保留最后两个(当前版本加上“备份”),并删除早期版本。

答案2

我的建议是安装 kernel-remover。

内核移除器

用于删除 Linux 内核包的工具。

此工具在处理测试内核时处理常见任务,删除弃用的内核映像、标头、依赖包、符号链接和相关驱动程序。/lib/modules/$KVERS 下未打包的垃圾将被清除。当前正在运行的内核和最新的内核都不会被删除。

维护者:Alf Gaida[电子邮件保护]

来源:http://svn.berlios.de/svnroot/repos/fullstory/kernel-remover

要安装 kerml-remover,请下载以下文件:

http://mirror.lug.udel.edu/pub/siduction/base/pool/main/c/creativecommons3/creativecommons3_1.1_all.deb

http://mirror.lug.udel.edu/pub/siduction/base/pool/main/k/kernel-remover/kernel-remover_3.1.11_all.deb

通过 Gdebi 安装它们,为了解决依赖关系,首先是 creativecommons3_1.1_all.deb。

编辑: - - - - - - - - - - -

测试一下:

使用实时 DVD-USB Trusty Tahr 启动计算机。

会话加载后,打开终端。

在终端中运行:

sudo su
fdisk -l
+++Suppose that / is /dev/sda1
umount /dev/sda1
fsck -a /dev/sda1
mount /dev/sda1 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
apt-get update
apt-get autoremove
apt-get clean
apt-get -f install
dpkg --configure -a
apt-get dist-upgrade
apt-get clean
grub-install /dev/sda
grub-install --recheck /dev/sda
update-grub
Control + D 
umount /mnt/sys
umount /mnt/proc
umount /mnt/dev
umount /mnt
reboot

结尾 - - - - - - - - - -

答案3

请检查此链接,重命名 postrm.d 目录可能会解决问题。 无法删除内核“run-parts:/etc/kernel/postrm.d/zz-update-grub 退出,返回代码 1”

相关内容