启动盘已满?

启动盘已满?

每当我尝试安装任何软件包时,我都会收到错误,提示我运行apt-get -f install. 来修复它们。

当我运行命令时,我收到以下消息:

$ sudo apt-get -f install
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:
  linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-headers-4.4.0-57
  linux-headers-4.4.0-57-generic linux-headers-4.4.0-59
  linux-headers-4.4.0-59-generic linux-headers-4.4.0-62
  linux-headers-4.4.0-62-generic linux-headers-4.4.0-63
  linux-headers-4.4.0-63-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-image-4.4.0-31-generic
  linux-image-4.4.0-57-generic linux-image-4.4.0-59-generic
  linux-image-4.4.0-62-generic linux-image-4.4.0-63-generic
  linux-image-4.4.0-64-generic linux-image-4.4.0-66-generic
  linux-image-extra-4.4.0-31-generic linux-image-extra-4.4.0-57-generic
  linux-image-extra-4.4.0-59-generic linux-image-extra-4.4.0-62-generic
  linux-image-extra-4.4.0-63-generic linux-image-extra-4.4.0-64-generic
  linux-image-extra-4.4.0-66-generic linux-signed-image-4.4.0-57-generic
  linux-signed-image-4.4.0-59-generic linux-signed-image-4.4.0-62-generic
  linux-signed-image-4.4.0-63-generic linux-signed-image-4.4.0-64-generic
  linux-signed-image-4.4.0-66-generic snap-confine
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-image-4.4.0-72-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-72-generic
0 upgraded, 1 newly installed, 0 to remove and 26 not upgraded.
10 not fully installed or removed.
Need to get 0 B/21.8 MB of archives.
After this operation, 66.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 539835 files and directories currently installed.)
Preparing to unpack .../linux-image-4.4.0-72-generic_4.4.0-72.93_amd64.deb ...
Done.
Unpacking linux-image-4.4.0-72-generic (4.4.0-72.93) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-72-generic_4.4.0-72.93_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-4.4.0-72-generic' to '/boot/vmlinuz-4.4.0-72-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-72-generic /boot/vmlinuz-4.4.0-72-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-72-generic /boot/vmlinuz-4.4.0-72-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-4.4.0-72-generic_4.4.0-72.93_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

看起来我的启动分区已满?看起来这些 linux-headers 文件已经过时且不再需要,但是清理这些包的最佳和最安全的方法是什么?

答案1

按照提示,运行

sudo apt autoremove

它会删除所有旧内核并清除 /boot。上次我遇到这个问题,然后解决了。

相关内容