Ubuntu do-release-upgrade fails with

When trying to run do-release-upgrade, the process stops with …

Not enough free disk space

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

A quick df will show that the /boot partition is indeed nearly full.

Filesystem                          1K-blocks    Used Available Use% Mounted on
/dev/mapper/glw–oee–serv–vg-root 100750768 3442692  92183572   4% /
udev                                  1012076       4   1012072   1% /dev
tmpfs                                  204388     264    204124   1% /run
none                                     5120       0      5120   0% /run/lock
none                                  1021920       0   1021920   0% /run/shm
/dev/sda1                              233191  212670      8080  97% /boot

The main reason is that the  /boot partition is filled with old kernels.  First check uname -a to check your current version as we are going to clean-up some of the old packages.  The run the following command to get a list of install kernel packages.

[codesyntax lang=”bash”]

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

[/codesyntax]

The output will look something like this:

server:~$ dpkg -l ‘linux-*’ | sed ‘/^ii/!d;/'”$(uname -r | sed “s/\(.*\)-\([^0-9]\+\)/\1/”)”‘/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d’
linux-headers-3.8.0-29
linux-headers-3.8.0-29-generic
linux-headers-3.8.0-30
linux-headers-3.8.0-30-generic
linux-headers-3.8.0-32
linux-headers-3.8.0-32-generic
linux-headers-3.8.0-33
linux-headers-3.8.0-33-generic
linux-headers-3.8.0-34
linux-headers-3.8.0-34-generic
linux-headers-3.8.0-35
linux-headers-3.8.0-35-generic
linux-headers-3.8.0-37
linux-headers-3.8.0-37-generic
linux-image-3.8.0-29-generic
linux-image-3.8.0-30-generic
linux-image-3.8.0-32-generic
linux-image-3.8.0-33-generic
linux-image-3.8.0-34-generic
linux-image-3.8.0-35-generic

Now use the following command to clean-up up some of those packages and free up space on /boot.

sudo apt-get -y purge some-kernel-package

Example: sudo apt-get -y purge linux-image-3.8.0-29-generic
  • Share:

Leave a Comment

Send a Message