My Ubuntu server instance's /boot partition is currently at 100%, and I want to remove some unused/unneeded dependencies using sudo apt-get autoremove. However, it appears that I am missing some dependencies, which I can't install since the dependencies are apparently needed in /boot, but, as stated earlier, is full. I tried using sudo apt-get autoremove -f to remove and fix dependencies, but it appears that it wants to install the dependencies before removing everything else. Is there a way to remove the unused depencies / packages without installing the missing dependencies? I have included my terminal output below if it helps at all.

mkoch@ubuntu:~$ sudo apt-get autoremove -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  linux-generic linux-headers-3.13.0-39 linux-headers-3.13.0-39-generic
  linux-headers-generic linux-image-3.13.0-39-generic
  linux-image-extra-3.13.0-39-generic linux-image-generic
Suggested packages:
  fdutils linux-doc-3.13.0 linux-source-3.13.0 linux-tools
The following packages will be REMOVED:
  linux-headers-3.13.0-24 linux-headers-3.13.0-24-generic
  linux-headers-3.13.0-27 linux-headers-3.13.0-27-generic
  linux-headers-3.13.0-29 linux-headers-3.13.0-29-generic
  linux-headers-3.13.0-30 linux-headers-3.13.0-30-generic
  linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic
  linux-headers-3.13.0-33 linux-headers-3.13.0-33-generic
  linux-headers-3.13.0-36 linux-headers-3.13.0-36-generic
  linux-headers-3.13.0-37 linux-headers-3.13.0-37-generic
  linux-image-3.13.0-24-generic linux-image-3.13.0-27-generic
  linux-image-3.13.0-29-generic linux-image-3.13.0-30-generic
  linux-image-3.13.0-32-generic linux-image-3.13.0-33-generic
  linux-image-extra-3.13.0-24-generic linux-image-extra-3.13.0-27-generic
  linux-image-extra-3.13.0-29-generic linux-image-extra-3.13.0-30-generic
  linux-image-extra-3.13.0-32-generic linux-image-extra-3.13.0-33-generic
  linux-image-extra-3.13.0-36-generic linux-image-extra-3.13.0-37-generic
The following NEW packages will be installed:
  linux-headers-3.13.0-39 linux-headers-3.13.0-39-generic
  linux-image-3.13.0-39-generic linux-image-extra-3.13.0-39-generic
The following packages will be upgraded:
  linux-generic linux-headers-generic linux-image-generic
3 upgraded, 4 newly installed, 30 to remove and 91 not upgraded.
12 not fully installed or removed.
Need to get 61.3 MB of archives.
After this operation, 1,488 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-image-3.13.0-39-generic i386 3.13.0-39.66 [14.6 MB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-image-extra-3.13.0-39-generic i386 3.13.0-39.66 [37.1 MB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-generic i386 [1,780 B]
Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-image-generic i386 [2,420 B]
Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-3.13.0-39 all 3.13.0-39.66 [8,892 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-3.13.0-39-generic i386 3.13.0-39.66 [716 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-generic i386 [2,404 B]
Fetched 61.3 MB in 4min 33s (224 kB/s)                                         
(Reading database ... 349968 files and directories currently installed.)
Removing linux-headers-3.13.0-36-generic (3.13.0-36.63) ...
Removing linux-headers-3.13.0-36 (3.13.0-36.63) ...
Selecting previously unselected package linux-image-3.13.0-39-generic.
(Reading database ... 325045 files and directories currently installed.)
Preparing to unpack .../linux-image-3.13.0-39-generic_3.13.0-39.66_i386.deb ...
Unpacking linux-image-3.13.0-39-generic (3.13.0-39.66) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.13.0-39-generic_3.13.0-39.66_i386.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-3.13.0-39-generic' to '/boot/vmlinuz-3.13.0-39-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 3.13.0-39-generic /boot/vmlinuz-3.13.0-39-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-39-generic /boot/vmlinuz-3.13.0-39-generic
Selecting previously unselected package linux-image-extra-3.13.0-39-generic.
Preparing to unpack .../linux-image-extra-3.13.0-39-generic_3.13.0-39.66_i386.deb ...
Unpacking linux-image-extra-3.13.0-39-generic (3.13.0-39.66) ...
Preparing to unpack .../linux-generic_3. ...
Unpacking linux-generic ( over ( ...
Preparing to unpack .../linux-image-generic_3. ...
Unpacking linux-image-generic ( over ( ...
Selecting previously unselected package linux-headers-3.13.0-39.
Preparing to unpack .../linux-headers-3.13.0-39_3.13.0-39.66_all.deb ...
Unpacking linux-headers-3.13.0-39 (3.13.0-39.66) ...
Selecting previously unselected package linux-headers-3.13.0-39-generic.
Preparing to unpack .../linux-headers-3.13.0-39-generic_3.13.0-39.66_i386.deb ...
Unpacking linux-headers-3.13.0-39-generic (3.13.0-39.66) ...
Preparing to unpack .../linux-headers-generic_3. ...
Unpacking linux-headers-generic ( over ( ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I was able to solve my problem by following flickerfly's answer on this AskUbuntu question. To paraphrase his answer:

  1. Run sudo dpkg --list 'linux-image*' to view currently installed kernels.
  2. Run uname -r to view the currently-used kernel.
  3. Run sudo rm -rf /boot/*-3.2.0-{23,45,49,51,52,53,54,55}-*, replacing the version number with the version number in your /boot partition, and entering in all of the version numbers in the curly braces, except for your current version and the two newest versions.
  4. Then run sudo apt-get -f install to clean up missing dependencies.
  5. Run sudo apt-get autoremove to remove any additional dependencies.

Again, this is just a paraphrase of the complete answer, but the points above provide the main points of flickerfly's answer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.