Ubuntu boot drive full

** DISCLAIMER **

Do this at your own risk

BACK UP!

Find out how much disk space is left.

sudo du -h /boot –max-depth=0

Reboot before you use this command to insure the system knows what the most current kernal is.

This will remove old kernels.  Leave off the -y (in red) to see what would be updated, but not actually update

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s