Can't upgrade ubuntu due to low disk space on /boot (Linux)

If you get some error like this while updating Ubuntu (Linux)

The upgrade has aborted. The upgrade needs a total of 56.7 M free space on disk ‘/boot’. Please free at least an additional 3,816 k of disk space on ‘/boot’. Empty your trash and remove temporary packages of former installations using ‘sudo apt-get clean’.

Reason:

Your file system doesn’t have enough free space to install new packages of newer version to /boot partition

Solution is:

1>Run following command on terminal

dpkg -l ‘linux-*’ | sed ‘/^ii/!d;/'”$(uname -r | sed “s/\(.*\)-\([^0-9]\+\)/\1/”)”‘/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d’

>>results will be like this
linux-headers-3.11.0-20
linux-headers-3.11.0-20-generic
linux-headers-3.11.0-22
linux-headers-3.11.0-22-generic
linux-headers-3.11.0-23
linux-headers-3.11.0-23-generic
linux-headers-3.11.0-24
linux-headers-3.11.0-24-generic
linux-image-3.11.0-20-generic
linux-image-3.11.0-22-generic
linux-image-3.11.0-23-generic
linux-image-3.11.0-24-generic
linux-image-3.5.0-48-generic
linux-image-extra-3.11.0-20-generic
linux-image-extra-3.11.0-22-generic
linux-image-extra-3.11.0-23-generic
linux-image-extra-3.11.0-24-generic
linux-image-extra-3.5.0-48-generic

2> Then run this command

uname -a

>>result will be

Linux user 3.11.0-26-generic #45-Ubuntu SMP Tue Jul 15 04:04:15 UTC 2014 i686 i686 i686 GNU/Linux

3> In the second step you will get kernel version currently running (3.11.0-26-generic ). Then what you should do is purge unwanted/old kernel image as follows

sudo apt-get purge linux-image-3.5.0-48-generic

Advertisements

One thought on “Can't upgrade ubuntu due to low disk space on /boot (Linux)

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