0

I am getting errors whenever I try to install any packages telling me to run apt-get -f install. to fix them.

When I run the command I get this message:

$ 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)

It appears my boot partition is full? It looks like these linux-headers files are outdated and not needed but what is the best and safest way to clean out these packages?

Zanna
  • 70,465
  • 1
    Check these questions. http://askubuntu.com/questions/171209/my-boot-partition-hit-100-and-now-i-cant-upgrade-cant-remove-old-kernels-to , http://askubuntu.com/questions/345588/what-is-the-safest-way-to-clean-up-boot-partition – ankit7540 Apr 09 '17 at 07:59
  • Did you try 'apt-get autoremove --purge' as suggested. It works very well for me. – Jean-Marie Apr 09 '17 at 12:00

1 Answers1

1

As it suggests, run

sudo apt autoremove

and it should remove all the old kernels and clear up /boot. Last time I had that issue that fixed it.

nullmeta
  • 446
  • 1
  • 3
  • 9