Runningsudo apt-get -f install
说道The link /vmlinuz.old is a damaged link
:
you may need to re-run your boot loader[grub]
以下是完整输出:
user@chrubuntu:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic
linux-image-3.13.0-32-generic linux-image-extra-3.13.0-32-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
user@chrubuntu:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic
linux-image-3.13.0-32-generic linux-image-extra-3.13.0-32-generic
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
After this operation, 270 MB disk space will be freed.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en
en",
LC_ALL = (unset),
LC_TIME = "en",
LC_MONETARY = "en",
LC_ADDRESS = "en",
LC_TELEPHONE = "en",
LC_NAME = "en",
LC_MEASUREMENT = "en",
LC_IDENTIFICATION = "en",
LC_NUMERIC = "en",
LC_PAPER = "en",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 232120 files and directories currently installed.)
Removing linux-headers-3.13.0-32-generic (3.13.0-32.57) ...
Removing linux-headers-3.13.0-32 (3.13.0-32.57) ...
Removing linux-image-extra-3.13.0-32-generic (3.13.0-32.57) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-32-generic /boot/vmlinuz-3.13.0-32-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-32-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-32-generic /boot/vmlinuz-3.13.0-32-generic
The link /initrd.img.old is a damaged link
Removing symbolic link initrd.img.old
you may need to re-run your boot loader[grub]
Removing linux-image-3.13.0-32-generic (3.13.0-32.57) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-32-generic /boot/vmlinuz-3.13.0-32-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-32-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-32-generic /boot/vmlinuz-3.13.0-32-generic
The link /vmlinuz.old is a damaged link
Removing symbolic link vmlinuz.old
you may need to re-run your boot loader[grub]
user@chrubuntu:~$
我如何重新运行引导加载程序?
答案1
根据womble 的回答到内核卸载后 /vmlinuz 和 /initrd.img 符号链接损坏(在服务器故障),当您的引导加载程序是 GRUB/GRUB2 时(这里就是),您无需执行任何操作。
对于其他一些引导加载程序(至少莉萝),有时显然需要手动运行引导加载程序的配置。
如果你做过需要告诉 GRUB 检查现有内核并更新其配置,运行sudo update-grub
即可。运行它并没有什么坏处。但在这种情况下,它不应该是必要的。
答案2
如果是 grub 的话,错误有点奇怪。
当 apt 安装新内核版本时,它会将 /vmlinuz 和 /initrd.img 移动到 /vmlinuz.old 和 /initrd.img.old(它们仍然指向当前活动的内核。再次注意 .old 扩展名,它与“内核卸载后损坏的链接”中链接的故事不同)并创建两个新文件 /vmlinuz /initrd.img。
当您运行apt-get autoremove
(消息不是由生成的apt-get -f install
)时,它会删除以前活动的内核(您在安装之后重新启动,然后运行自动删除,对吗?),这会使链接无效。
当内核本身的删除完成后,autoremove 本身会调用 update-grub:
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-32-generic /boot/vmlinuz-3.13.0-32-generic
因此:
The link /vmlinuz.old is a damaged link
Removing symbolic link vmlinuz.old
you may need to re-run your boot loader[grub]
因此,autoremove 会执行以下操作:
- 删除旧内核
- 运行更新-grub
- update-grub 删除链接到已删除文件的 .old 文件。
完全不用担心 :-)
问候。
答案3
$ sudo update-grub
如果你想删除/清除旧包你也可以这样做
$ dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge