/dev/sda1 /boot 已满

/dev/sda1 /boot 已满

我知道有很多这样的问题,但我已经尽力去了解该怎么做,但却失败了。

df -h知道我的/dev/sda1 /boot利用率是100%。

我完全不明白我应该删除什么。我正在运行 nginx 并想安装 nodejs,但在尝试时我被警告未满足依赖项,sudo apt-get install nodejssudo apt-get -f install因空间不足而失败。我可以就这一点获得一些具体指导吗?我感觉完全迷茫了。

dpkg --list | grep linux-image:

ii  linux-image-3.8.0-29-generic      3.8.0-29.42~precise1                 Linux kernel image for version 3.8.0 on 32 bit x86 SMP
ii  linux-image-3.8.0-34-generic      3.8.0-34.49~precise1                 Linux kernel image for version 3.8.0 on 32 bit x86 SMP
ii  linux-image-3.8.0-35-generic      3.8.0-35.52~precise1                 Linux kernel image for version 3.8.0 on 32 bit x86 SMP
ii  linux-image-3.8.0-36-generic      3.8.0-36.52~precise1                 Linux kernel image for version 3.8.0 on 32 bit x86 SMP
ii  linux-image-3.8.0-37-generic      3.8.0-37.53~precise1                 Linux kernel image for version 3.8.0 on 32 bit x86 SMP
ii  linux-image-3.8.0-38-generic      3.8.0-38.56~precise1                 Linux kernel image for version 3.8.0 on 32 bit x86 SMP
ii  linux-image-3.8.0-39-generic      3.8.0-39.58~precise1                 Linux kernel image for version 3.8.0 on 32 bit x86 SMP
ii  linux-image-3.8.0-42-generic      3.8.0-42.62~precise1                 Linux kernel image for version 3.8.0 on 32 bit x86 SMP
iU  linux-image-generic-lts-raring    3.8.0.44.44                          Generic Linux kernel image

uname -r:
3.8.0-42-generic

sudo apt-get purge linux-image-x.x.x.x-generic

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
 linux-image-generic-lts-raring : Depends: linux-image-3.8.0-44-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 install

dpkg: error processing /var/cache/apt/archives/linux-image-3.8.0-44-generic_3.8.0-44.66~precise1_i386.deb (--unpack):
 failed in write on buffer copy for backend dpkg-deb during ./boot/vmlinuz-3.8.0-44-generic': No space left on device
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.8.0-44-generic /boot/vmlinuz-3.8.0-44-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.8.0-44-generic /boot/vmlinuz-3.8.0-44-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.8.0-44-generic_3.8.0-44.66~precise1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

/boot包含(除其他内容外)您已安装的 Linux 内核。这些内核会不时更新。

打开终端并输入 dpkg --list | grep linux-image,然后点击ENTER

然后将其输出与 uname -r
...进行比较,其中输出告诉您正在使用上述哪个内容。

所有其他文件都可以删除,释放空间 - 除非您有理由保留它们。这可以通过替换此处的“linux-image-xxxx-generic”来实现:

sudo apt-get purge linux-image-xxxx-generic

对于每一个您想要删除的。

然后,在最后一次之后,你必须这样做来清理/重新创建启动菜单

sudo update-initramfs -u # 重新制作启动 ramdisk
sudo update-grub2 #重新创建启动菜单


编辑
这...

查找/ boot -type f -printf“%-16s%p \ n”| sort -nr | head -n 20

... 将显示 /boot 中最大的 20 个文件

相关内容