3

How do I free up space on /boot?

ls /boot/

    abi-4.2.0-16-generic         memtest86+.bin
    abi-4.2.0-19-generic         memtest86+.elf
    abi-4.2.0-22-generic         memtest86+_multiboot.bin
    config-4.2.0-16-generic      System.map-4.2.0-16-generic
    config-4.2.0-19-generic      System.map-4.2.0-19-generic
    config-4.2.0-22-generic      System.map-4.2.0-22-generic
    efi                          vmlinuz-4.2.0-16-generic
    grub                         vmlinuz-4.2.0-19-generic
    initrd.img-4.2.0-16-generic  vmlinuz-4.2.0-19-generic.efi.signed
    initrd.img-4.2.0-19-generic  vmlinuz-4.2.0-22-generic
    initrd.img-4.2.0-22-generic  vmlinuz-4.2.0-22-generic.efi.signed
    lost+found

I am very novice user. I took a look at: How do I free up more space in /boot?, but the information seemed too complicated for me. I was hoping a simple answer to my specific problem.

Pepe
  • 978
  • 7
  • Why do you need to? The boot partition is pretty tiny, and you kinda need everything in there –  Jan 08 '16 at 15:11
  • Updates.. it's telling me I need to free up around 40mb I think. – Pepe Jan 08 '16 at 15:12
  • It looksToo complicated for you? Who installed Ubuntu with a separate and small /boot partition? That was initially a bad idea. It looks like the partition is just enough for 3 kernels. You will have always remove kernels manually as it is explained in the too complicated answer. – Pilot6 Jan 08 '16 at 15:20
  • If you manually partition the disk, you commit to be technical enough for it. Otherwise just install Ubuntu with auto partitioning. – Pilot6 Jan 08 '16 at 15:28
  • Worth noting that some hosting providers stuck in the dark ages provision servers in rebuilds with really tiny /boot/ partitions, and not in an easily expandable partition. This is fine for a few updates, but I've seen default builds with 200mb space, which used to be sufficient 10 years ago, however not anymore! – Laice Jan 09 '16 at 20:16
  • Or you can use Ubuntu Tweaks. http://askubuntu.com/a/553595/16395 – Rmano Jan 09 '16 at 22:20

2 Answers2

4
sudo apt-get autoremove

Might help, it will remove old unused kernel images, but if the /boot partition is that small, you may consider resizing it.

  • Worth noting that sometimes APT requires space in /boot/ to remove the unused kernels. Resolvable by running "uname -r" (shows current in-use kernel) and removing ONLY older kernels that are not in use - then running apt-get remove apt-get remove linux-image-4.2.0.version --purge – Laice Jan 09 '16 at 20:12
0

While autoremove will possible clear some space it will not remove older kernels which can still be selected by grub. I check in these cases which kernel I am running with cat /proc/version.
Since the version you are running at that moment is boot-able I remove all older kernels using: sudo apt-get remove linux-image-4.2.0.*version*
You can use regular expressions in this, so you are probably running 4.2.0-22 and can remove all older. That can be done by:
sudo apt-get remove linux-image-4.2.0-1.* (Check for more detail here)

Do not just trow away the files which are not in use, though it will work it will keep on generating grub errors on updates. Not really harmful but it is annoying.

Requist
  • 2,389
  • 2
  • 22
  • 32
  • 3
    apt-get doesn't use wildcards, it uses regular expressions. – muru Jan 09 '16 at 19:47
  • Oh? funny, I always presumed it were wildcards but I actually only use the asterisk. Was I always lucky to have a dot in front of the asterisk or just a bit blind; I'll check and update my answer, thanks!. – Requist Jan 09 '16 at 19:52
  • Linking to http://askubuntu.com/q/210976/158442 should be enough. – muru Jan 09 '16 at 19:52