九溪

溪水润知林,滴露启慧心

用户工具

站点工具


wiki:linux:boot-space-free

/boot 空间不足,导致安装、更新失败

错误信息

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-#.#.#-##-generic with 1.
dpkg: error processing initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

或者

Not enough free disk space 

The upgrade has aborted. The upgrade needs a total of 101 M free 
space on disk '/boot'. Please free at least an additional 101 M of 
disk space on '/boot'. You can remove old kernels using 'sudo apt 
autoremove' and you could also set COMPRESS=xz in 
/etc/initramfs-tools/initramfs.conf to reduce the size of your 
initramfs. 

或者

The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-131 linux-headers-4.4.0-131-generic linux-headers-4.4.0-133
  linux-headers-4.4.0-133-generic linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic
  linux-headers-4.4.0-137 linux-headers-4.4.0-137-generic linux-headers-4.4.0-139
  linux-headers-4.4.0-139-generic linux-headers-4.4.0-62 linux-headers-4.4.0-62-generic
  linux-image-4.4.0-131-generic linux-image-4.4.0-133-generic linux-image-4.4.0-134-generic
  linux-image-4.4.0-137-generic linux-image-4.4.0-139-generic linux-image-4.4.0-62-generic
  linux-image-extra-4.4.0-131-generic linux-image-extra-4.4.0-133-generic
  linux-image-extra-4.4.0-134-generic linux-image-extra-4.4.0-137-generic
  linux-image-extra-4.4.0-139-generic linux-image-extra-4.4.0-62-generic
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  linux-image-4.4.0-139-generic linux-image-4.4.0-164-generic linux-modules-4.4.0-164-generic
Suggested packages:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following NEW packages will be installed:
  linux-image-4.4.0-139-generic linux-image-4.4.0-164-generic linux-modules-4.4.0-164-generic
0 upgraded, 3 newly installed, 0 to remove and 135 not upgraded.
7 not fully installed or removed.
Need to get 41.0 MB of archives.
After this operation, 135 MB of additional disk space will be used.

解决办法

空间不够,先清理空间

cd /boot
rm abi-4.4.0-133-generic 
rm config-4.4.0-133-generic 
rm initrd.img-4.4.0-133-generic 
rm retpoline-4.4.0-133-generic 
rm System.map-4.4.0-133-generic 
rm vmlinuz-4.4.0-133-generic

查看当前系统内核

uname -a

查看已安装的内核

dpkg -l 'linux-image-*' | grep '^ii'

逐个删除不用的内核

sudo apt-get purge linux-image-4.4.0-137-generic
sudo apt-get purge linux-image-4.4.0-138-generic 
sudo apt-get purge linux-image-4.4.0-139-generic
sudo apt-get purge linux-image-4.4.0-164-generic
sudo apt-get purge linux-image-4.4.0-62-generic

参考:

评论

请输入您的评论. 可以使用维基语法:
 
wiki/linux/boot-space-free.txt · 最后更改: 2023/01/03 15:25 由 127.0.0.1