可能已经删除了内核,但还没有关机。

我的/boot已满,无法进行更新,因此我尝试删除不必要的文件,但我可能删除了一些不应该删除的东西。我不知道grub或grub2是否可以工作,也不知道能否仍然启动Windows。然而,我还没有关机,所以希望现在可以修复所有问题。我应该怎么办?

我使用了以下命令:

for akernel in $(dpkg -l 'linux-' | sed '/^ii/!d;/'"$(uname -r | sed "s/(.)-([^0-9]+)/\1/")"'/d;s/^[^ ]* [^ ]* ([^ ])./\1/;/[0-9]/!d'); do sudo apt-get purge $akernel; done

uname -r

3.13.0-66-generic

ls -lhA /boot
总共29M -rw-r--r-- 1 root root 1.2M Oct 7 12:34 abi-3.13.0-66-generic -rw-r--r-- 1 root root 162K Oct 7 12:34 config-3.13.0-66-generic drwxr-xr-x 5 root root 1.0K Dec 17 21:41 grub -rw-r--r-- 1 root root 19M Oct 30 18:15 initrd.img-3.13.0-66-generic drwx------ 2 root root 12K Feb 7 2015 lost+found -rw-r--r-- 1 root root 173K Mar 12 2014 memtest86+.bin -rw-r--r-- 1 root root 174K Mar 12 2014 memtest86+.elf -rw-r--r-- 1 root root 175K Mar 12 2014 memtest86+_multiboot.bin -rw------- 1 root root 3.3M Oct 7 12:34 System.map-3.13.0-66-generic -rw------- 1 root root 5.6M Oct 7 12:34 vmlinuz-3.13.0-66-generic

du -h /boot

du: 无法读取目录‘/boot/lost+found’:权限被拒绝

12K /boot/lost+found

2.1M /boot/grub/i386-pc

9.0K /boot/grub/locale

2.3M /boot/grub/fonts

6.7M /boot/grub 36M /boot

df -h /boot

文件系统 大小 已用 可用 使用% 挂载点

/dev/sda3 361M 180M 159M 54% /boot


你可以尝试重新安装它。内核可以通过apt-get获取。你的版本是多少? - Sergiy Kolodyazhnyy
Ubuntu 14.04 LTS。当我输入uname -r时,我得到的是3.13.0-66-generic。我不知道那实际上意味着什么。 - nothing works
2好的,14.04是可靠的,所以只需运行sudo apt-get install --reinstall linux-image-generic-lts-trusty - Sergiy Kolodyazhnyy
1个回答

打开终端并输入以下命令:
sudo apt-get install --reinstall linux-image-generic sudo grub-install /dev/sdX sudo update-grub
其中,将
/dev/sdX
替换为您的GRUB引导加载程序所安装的驱动器。通常情况下,用户不应包括分区号,否则会出现错误消息,因为该命令会尝试将信息写入分区。您可以使用Disks应用程序找到此驱动器的设备名称。在Disks中仔细检查两次,确保输入正确的GRUB引导加载程序所安装的驱动器的设备名称。
由于在执行sudo grub-install命令时没有完成此操作,运行sudo update-grub安装后将确保GRUB菜单是最新的。