/Boot 中磁盘空间不足,无法升级

/Boot 中磁盘空间不足,无法升级

我已经使用 ubuntu 3 个月了,遇到了这个问题。出现一条错误消息,指出

具有未满足依赖关系的软件包,更新

当我尝试更新时,它说

/Boot 中没有足够的磁盘空间。

我查找了该论坛中一些其他答案并运行了那里发布的命令行,但无法解决我的问题。

我把我的终端输出粘贴在下面。

图像

运行 apt-get -f install 命令并得到此输出。

nram772@nram772-Lenovo-Z50-70:~$ sudo apt-get install -f
[sudo] password for nram772: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libgles1-mesa linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-headers-4.4.0-64 linux-headers-4.4.0-64-generic
  linux-headers-4.4.0-66 linux-headers-4.4.0-66-generic linux-headers-4.4.0-72 linux-headers-4.4.0-72-generic linux-headers-4.4.0-75
  linux-headers-4.4.0-75-generic linux-headers-4.4.0-77 linux-headers-4.4.0-77-generic linux-headers-4.4.0-78
  linux-headers-4.4.0-78-generic linux-image-4.4.0-31-generic linux-image-4.4.0-64-generic linux-image-4.4.0-66-generic
  linux-image-4.4.0-72-generic linux-image-4.4.0-75-generic linux-image-4.4.0-77-generic linux-image-4.4.0-78-generic
  linux-image-extra-4.4.0-31-generic linux-image-extra-4.4.0-64-generic linux-image-extra-4.4.0-66-generic
  linux-image-extra-4.4.0-72-generic linux-image-extra-4.4.0-75-generic linux-image-extra-4.4.0-77-generic
  linux-image-extra-4.4.0-78-generic snap-confine ubuntu-core-launcher xsane-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-image-4.4.0-83-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-83-generic
0 to upgrade, 1 to newly install, 0 to remove and 58 not to upgrade.
19 not fully installed or removed.
Need to get 21.9 MB of archives.
After this operation, 66.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-image-4.4.0-83-generic amd64 4.4.0-83.106 [21.9 MB]
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-image-4.4.0-83-generic amd64 4.4.0-83.106 [21.9 MB]                  
Fetched 19.4 MB in 14min 13s (22.7 kB/s)                                                                                                    
(Reading database ... 479502 files and directories currently installed.)
Preparing to unpack .../linux-image-4.4.0-83-generic_4.4.0-83.106_amd64.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/intel-microcode 4.4.0-83-generic /boot/vmlinuz-4.4.0-83-generic
Done.
Unpacking linux-image-4.4.0-83-generic (4.4.0-83.106) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-83-generic_4.4.0-83.106_amd64.deb (--unpack):
 cannot copy extracted data for './boot/abi-4.4.0-83-generic' to '/boot/abi-4.4.0-83-generic.dpkg-new': failed to write (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 4.4.0-83-generic /boot/vmlinuz-4.4.0-83-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-83-generic /boot/vmlinuz-4.4.0-83-generic
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-4.4.0-83-generic_4.4.0-83.106_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

不,我没有为 /Boot 创建任何分区或分配额外的空间。

答案1

not enough disk space in /Boot.

您能否说明一下您是否为 /boot 使用单独的磁盘分区?如果您进行了自定义安装并创建了单独的启动分区,则可能没有为其分配足够的空间。我个人为 /boot 分区分配了 1GB 的空间。

答案2

这可能是由于安装了太多旧内核造成的。

如果您对当前内核感到满意并想要删除所有旧内核,则可以使用此命令删除除当前使用的内核之外的所有内核:

sudo dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'uname -r'/q;p' | xargs sudo apt-get -y purge

我从这个答案中得到了这个:https://askubuntu.com/a/254585/19779。我刚刚在自己的电脑上运行了它,以确保它按预期工作。它释放了 650MB。:)

相关内容