1

This question already has an answer here:

I keep getting the following message and am new to Ubuntu. Not sure how to increase the space in boot volume from other partition.

The volume "boot" has only 2.8 mb disk space remaining

it also suggests "you can free up disk space by removing unused programs or files, or by moving files to another disk or partition"

can someone help?

Thanks

marked as duplicate by Pilot6, Mitch Jan 11 '16 at 11:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Seems duplicated with : What is the safest way to clean up /boot partition?

Get the list of kernel images (this command will show installed kernels except the currently running one) :

sudo dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r` 

Note the two newest versions in the list to keep it. Delete all files in /boot for kernels except the current and two newest kernel images. Example:

sudo rm -rf /boot/*-3.13.0-{23,45,49}-*.

Then, clean up what's making apt grumpy about a partial install :

sudo apt-get -f install 
sudo apt-get autoremove

If you run into an error that includes a line like "Internal Error: Could not find image (/boot/vmlinuz-3.2.0-56-generic)", then run the command sudo apt-get purge linux-image-3.2.0-56-generic (with your appropriate version).

EvanK wrote a good python script here to automate this cleaning : https://github.com/EvanK/ubuntu-purge-kernels

  • Are these images only used for the host system or do services like VirtualBox consume them? In other words, is it always safe to keep only the two newest? – TylersSN Mar 30 '17 at 13:01
  • Host machine and virtual hosts have their own /boot. You can clean a system (and crash it :)) without impact other ones. – Florent L. Apr 2 '17 at 22:32

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